raise exception on error response