detect rest server styled errors

Recently I start to receive eventually response from $facebook->api('/me') call as error array:

    array (
        'error_code' => 1,
        'error_msg' => 'An unknown error occurred',
    )

This response might easily break application w/o any reason, cause no exception was thrown.
FacebookApiException is able to handle this response, but it was not checked properly.