AsanaError
+ Inheritance diagram for AsanaError:

Description

An Api error.

Codes less than 400 are cURL errors.

The Api returns null on 404, it doesn't throw.

See also
https://developers.asana.com/docs/errors

Public Properties

readonly array array $curlInfo
 cURL context More...
 

Public Methods

 __construct (int $code, string $message, array $curlInfo)
 
array asResponse ()
 Decodes and returns Asana's error JSON. More...
 
bool is (int $code)
 
bool isCurl ()
 Whether the error was due to cURL failure. More...
 

Properties

◆ $curlInfo

readonly array array $curlInfo

cURL context

Constructor

◆ __construct()

__construct ( int  $code,
string  $message,
array  $curlInfo 
)
Parameters
int$code
string$message
array$curlInfo

Methods

◆ asResponse()

array asResponse ( )
final

Decodes and returns Asana's error JSON.

Returns
array

◆ is()

bool is ( int  $code)
final
Parameters
int$code
Returns
bool

◆ isCurl()

bool isCurl ( )
final

Whether the error was due to cURL failure.

Returns
bool