Fixing exception handling for connection.

$return[‘err_code’] is actually a string and won’t work as the second
argument to Exception class.