CRM V2

ApiErrorException extends Exception

This would be thrown if any of the case referenced in \LDC\LDCCRM\Enums\ApiError would occur within the crm

On the client an ApiErrorException would also be throw with the ApiError corresponding to the situation

Tags
subpackage

exceptions

Table of Contents

$error  : ApiError
Api Error This value makes the error more explicit.
$httpCode  : int
This is the http code returned by the crm.
$message  : string
This is an explicit error message, ou may print this to the front or not depending on $error value
__construct()  : mixed
Create a new exception base on ApiError enum.
getApiError()  : ApiError
Get the Api Error
getStatusCode()  : int
Get the http code
report()  : void
This is used by laravel only.

Properties

$error

Api Error This value makes the error more explicit.

protected ApiError $error

Handling these errors are normal as inputs or request may be undesired or refused by the crm.

$httpCode

This is the http code returned by the crm.

protected int $httpCode

This value could be used to handle errors. But please take in consideration $error first

$message

This is an explicit error message, ou may print this to the front or not depending on $error value

protected string $message

Methods

__construct()

Create a new exception base on ApiError enum.

public __construct(ApiError $error[, int $httpCode = 400 ][, string $message = '' ][, Throwable|null $previous = null ]) : mixed
Parameters
$error : ApiError
$httpCode : int = 400
$message : string = ''
$previous : Throwable|null = null
Return values
mixed —

getStatusCode()

Get the http code

public getStatusCode() : int
Return values
int —

report()

This is used by laravel only.

public report() : void

It uses Log class to print the error.

Tags
codeCoverageIgnore
Return values
void —

Search results