String exception on compare, from exit status of mysqldump

I would greatly appreciate help overcoming this issue. Had me stumped
for at least an hour. Background is I am trying to automate mysqldump
and log errors.

Currently by the below code it will dump the database but an exception
occurs if there is nothing wrong (mysqldump returns nothing) but if
there is an error, if () becomes true and logs appropriately.

dump_cmd = “mysqldump -h " + row[‘dbhost’] + " -u " + row[‘dbun’] + "
-p” + row[‘dbpw’] +" " + row[‘dbname’] + " | gzip -9 >
backup_directory/backupfile.sql.gz"

dbcompress_result = ssh.exec!(dump_cmd)

begin
if dbcompress_result[0] == ‘m’
logger.error(“DB error #{row[‘server’]} ::
#{dbcompress_result}”)
end
rescue
end

Also the error thrown is uninitialized constant Errno::Disconnect
Thanks in advance!
Will