Stack.PHP
A simple and easy to use PHP library for the Stack Exchange API.
Public Member Functions | List of all members
APIException Class Reference

Represents an exception that occurs inside Stack.PHP code. More...

Inheritance diagram for APIException:

Public Member Functions

 __construct ($message, $url=null, $details='', $error_code=0)
 Constructor for an API exception. More...
 
 __toString ()
 Returns a string representation of the exception. More...
 
 Message ()
 Returns a brief description of the error. More...
 
 URL ()
 Returns the URL that generated the exception. More...
 
 ErrorCode ()
 Returns an error code associated with the exception. More...
 
 Details ()
 Returns additional details about the exception. More...
 

Detailed Description

Represents an exception that occurs inside Stack.PHP code.

This class exists to extend the information that is available when an exception occurs. Additional information, such as URL and API error code / message are able to be captured and stored with the exception.

Constructor & Destructor Documentation

◆ __construct()

APIException::__construct (   $message,
  $url = null,
  $details = '',
  $error_code = 0 
)

Constructor for an API exception.

Parameters
$messagea brief message describing the exception
$urlthe URL that raised the exception
$detailsmore detailed information about the exception
$error_codean error code associated with the exception

Member Function Documentation

◆ __toString()

APIException::__toString ( )

Returns a string representation of the exception.

Returns
a string containing exception information

◆ Details()

APIException::Details ( )

Returns additional details about the exception.

Returns
details about the exception

◆ ErrorCode()

APIException::ErrorCode ( )

Returns an error code associated with the exception.

Returns
the error code

◆ Message()

APIException::Message ( )

Returns a brief description of the error.

Returns
the error description

◆ URL()

APIException::URL ( )

Returns the URL that generated the exception.

Returns
the URL object

The documentation for this class was generated from the following file: