PHPCap Docs | PHPCap API
Overview

Namespaces

  • IU
    • PHPCap
  • PHP

Classes

  • ErrorHandler
  • FileUtil
  • RedCap
  • RedCapApiConnection
  • RedCapProject

Interfaces

  • ErrorHandlerInterface
  • RedCapApiConnectionInterface

Exceptions

  • PhpCapException
  • Overview
  • Namespace
  • Class

Class PhpCapException

Exception class for PHPCap exceptions. This is the exception that PHPCap will throw when it encounters an error.

Example usage:

try {
    $projectInfo = $project->exportProjectInfo();
}
catch (PhpCapException $exception) {
    print "The following error occurred: {$exception->getMessage()}\n";
    print "Error code: {$exception->getCode()}\n";
    $connectionErrorNumber = $exception->getConnectionErrorNumber();
    if (isset($connectionErrorNumber)) {
        print "A connection error occurred.\n";
        print "Connection error number: {$connectionErrorNumber}\n";
    }
    print "Stack trace:\n{$exception->getTraceAsString()}\n";
}
Exception
Extended by IU\PHPCap\PhpCapException
Namespace: IU\PHPCap
See:

http://php.net/manual/en/class.exception.php Information on additional methods provided by parent class Exception.


Located at PhpCapException.php
Methods summary
public
+/- __construct( string $message, integer $code, integer $connectionErrorNumber = null, integer $httpStatusCode = null, Exception $previous = null )

Constructor.

Constructor.

Parameters

$message
the error message.
$code
the error code.
$connectionErrorNumber

the connection error number (set to null if no connection error occurred).

$httpStatusCode
the HTTP status code (set to null if no HTTP status code was returned).
$previous
the previous exception.

Overrides

Exception::__construct()
public integer|null
+/- getConnectionErrorNumber( )

Returns the connection error number, or null if there was no connection error. The possible numbers returned will depend on the type of connection class being used. For example, if cURL is being used, then the cURL error number would be returned.

Returns the connection error number, or null if there was no connection error. The possible numbers returned will depend on the type of connection class being used. For example, if cURL is being used, then the cURL error number would be returned.

Returns

integer|null
connection error number, or null if there was no connection error.
public integer|null
+/- getHttpStatusCode( )

Returns the HTTP status code, or null if this was not set.

Returns the HTTP status code, or null if this was not set.

Returns

integer|null
HTTP status code, or null if this was not set.
Methods inherited from Exception
__toString(), __wakeup(), getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString()
PHPCap API documentation generated by ApiGen