BasketEmptyException

Extends \NextEvent\PHPSDK\Exception\APIResponseException

Thrown when a basket could not be found or is expired

Thrown when a request to the NextEvent API failed with an error response. The exception provides extensive information about the request sent, the response received and the reasons which it didn't succeed.

Use the toLogContext() or dumpAsString() methods for logging.

package

NextEvent\PHPSDK\Exception

Methods

Exception constructor

__construct(string|\Exception $message, integer $code, \Exception $ex = null) 
inherited

Arguments

$message

string|\Exception

Error message or source exception

$code

integer

Error code

$ex

\Exception

Previous exception

Produces a string representation of this object

__toString() : string
inherited

Response

string

Returns a full string representation of this exception

dumpAsString(boolean $withStackTrace = false) : string
inherited

Including HTTP request, response and stack trace (optional)

Arguments

$withStackTrace

boolean

Append stack trace to output

Response

string

Get the error description provided by the API

getDescription() : string
inherited

Response

string

Get the sent HTTP request message

getRequest() : \GuzzleHttp\Psr7\Request
inherited

Response

\GuzzleHttp\Psr7\Request

Get the unique identifier of the API request

getRequestID() : string
inherited

Use this in support inquiries to let us track the request in our logs

Response

string

Get the received HTTP response message

getResponse() : \GuzzleHttp\Psr7\Response
inherited

Response

\GuzzleHttp\Psr7\Response

Get HTTP response status code

getStatusCode() : integer|null|string
inherited

Response

integer|null|string

For convenience provide function to convert Exception to Context for logs

toLogContext() : array
inherited

Response

array