I am using the PHP client library.
Sometimes when catching
\Asana\Errors Exceptions, the Exception code will be 0 yet have a member
status with the actual HTTP response code.
Is this a known issue or does the team not consider this to be an issue? I just figured it might not be intended since
getCode() will actually be the HTTP code while other times it will be 0 and the
status member will have the HTTP code.
I found this particular behavior when calling
$client->tags->create() with an invalid
workspace gid param. The call threw an
int(0) and a
status member variable of
If memory serves, calling
$client->tasks->findById() actually returns a
int(404) which I have been depending on. Yet, I did notice that same call returning
Forbidden would not actually have a
getCode() of 403—I just didn’t think too much of it at the time!
So I’m a little confused what’s intended, but I prefer to
catch(\Exception $e) to then perform actions based on error code ranges as opposed to catching by each custom Exception type.
What is the difference between
status more reliable? Are they supposed to be the same?