inc\classes\apiException.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
File, that contains throwable
Author
Sergey Dilong  
License
GPL-2.0  
Package
Temply-Account\Core  

\apiException

Package: Temply-Account\Core
Custom exception

Terminates the script and displays error, if wasn't catched

Parent(s)
\Exception
Author
Sergey Dilong  
License
GPL-2.0  

Properties

>VPropertyprivateinteger $APIcode

Recieved error code

Details
Type
integer
See
Get this field outside the class  
>VPropertyprivatearray $o = array()

Additional options

Default valuearray()Details
Type
array
See
Get this field outside the class  

Methods

methodpublic__construct(integer $code, array $o = array()) : void

Throw the Exception

Define APIError code and options to terminate the script and show an error message to user

It's used to stop execution and show an error to user if happens something critical. In some cases classes/methods/functions (such as class User) can throw this object. If you would like to prevent terminating and error displaying you can catch the exception

Parameters
NameTypeDescription
$codeinteger

API Error code

$oarray

Additional fields for error

Details
Example
The Exception could be throwed by statements  
Example
Catching an exception to do other tasks  
See
Error init  
See
Get error message  
methodpublicgetAPICode() : integer

Error Code

Get Error code, which was provided by Exception thrower. Used for internal purposes.

Returns
TypeDescription
integerThe API Error code
Details
See
Error generation  
Uses
to get error code  
methodpublicgetO() : array

Error Extended

Get API Error Extended details, if they were provided. Used for internal purposes.

Returns
TypeDescription
arrayExtended details
Details
See
Error generation  
Uses
to get Extended Error  
Documentation was generated by phpDocumentor v2.9.0.