Server-Exception

This exception type will be thrown by the client when the server returns an error in response to a client request.

The exception code is the HTTP status code as returned by the server. In case the server provides additional details about the error, these details can be queried using the getDetails() function.

package ArangoDBClient
since 0.2
inherited_from \ArangoDBClient\Exception

 Methods

Exception constructor.

__construct(string $message = '', integer $code = 0, \Exception $previous = null
Inherited

Parameters

$message

string

$code

integer

$previous

\Exception

Return a string representation of the exception

__toString() : string

Returns

string- string representation

Turn off exception logging

disableLogging() 
InheritedStatic

Turn on exception logging

enableLogging() 
InheritedStatic

Get exception details

getDetails() : array

If the server has provided additional details about the error that occurred, they can be queries using the method

Returns

array- array of details

Get server error code

getServerCode() : integer

If the server has provided additional details about the error that occurred, this will return the server error code

Returns

integer- server error code

Get server error message

getServerMessage() : string

If the server has provided additional details about the error that occurred, this will return the server error string

Returns

string- server error message

Set exception details

setDetails(array $details) : void

If the server provides additional details about the error that occurred, they will be put here.

Parameters

$details

array
  • array of exception details

 Properties

 

Optional details for the exception

$_details 

Default

array()
param
 

$enableLogging

$enableLogging 

Default

false
Static

 Constants

 

Error number index

ENTRY_CODE = 'errorNum' 
 

Error message index

ENTRY_MESSAGE = 'errorMessage'