PHPCap API

ErrorHandlerInterface

Interface for error handlers for PHPCap.

Table of Contents

CA_CERTIFICATE_FILE_NOT_FOUND  = 4
A CA certificate file was specified, but it could not be found.
CA_CERTIFICATE_FILE_UNREADABLE  = 5
The CA certificate file could not be read.
CONNECTION_ERROR  = 6
A connection error occurred.
INPUT_FILE_ERROR  = 12
The input file contents are invalid.
INPUT_FILE_NOT_FOUND  = 10
The input file could not be found.
INPUT_FILE_UNREADABLE  = 11
The input file was found, but is unreadable.
INVALID_ARGUMENT  = 1
Invalid argument passed to a PHPCap method.
INVALID_URL  = 3
An invalid URL was used.
JSON_ERROR  = 8
A JSON error occurred. This would typically happen when PHPCap is expecting the REDCap API to return data in JSON format, but the result returned is not valid JSON.
OUTPUT_FILE_ERROR  = 9
The output file could not be found, or was found and could not be written
REDCAP_API_ERROR  = 7
The REDCap API generated an error.
TOO_MANY_ARGUMENTS  = 2
Too many arguments were passed to the method.
throwException()  : mixed
Throw an exception for the specified values.

Constants

CA_CERTIFICATE_FILE_NOT_FOUND

A CA certificate file was specified, but it could not be found.

public mixed CA_CERTIFICATE_FILE_NOT_FOUND = 4

CA_CERTIFICATE_FILE_UNREADABLE

The CA certificate file could not be read.

public mixed CA_CERTIFICATE_FILE_UNREADABLE = 5

INPUT_FILE_NOT_FOUND

The input file could not be found.

public mixed INPUT_FILE_NOT_FOUND = 10

INPUT_FILE_UNREADABLE

The input file was found, but is unreadable.

public mixed INPUT_FILE_UNREADABLE = 11

INVALID_ARGUMENT

Invalid argument passed to a PHPCap method.

public mixed INVALID_ARGUMENT = 1

JSON_ERROR

A JSON error occurred. This would typically happen when PHPCap is expecting the REDCap API to return data in JSON format, but the result returned is not valid JSON.

public mixed JSON_ERROR = 8

OUTPUT_FILE_ERROR

The output file could not be found, or was found and could not be written

public mixed OUTPUT_FILE_ERROR = 9

TOO_MANY_ARGUMENTS

Too many arguments were passed to the method.

public mixed TOO_MANY_ARGUMENTS = 2

Methods

throwException()

Throw an exception for the specified values.

public throwException(string $message, int $code[, int $connectionErrorNumber = null ][, int $httpStatusCode = null ][, Throwable $previousException = null ]) : mixed
Parameters
$message : string

message describing the error that occurred.

$code : int

the error code.

$connectionErrorNumber : int = null

the error number from the underlying connection used, of null if no connection error occurred. For example, if cURL is being used (the default) this will be the cURL error number if a connection error occurs.

$httpStatusCode : int = null

https status code, which would typcially be set if an error occurs with the http response from the REDCap API.

$previousException : Throwable = null

the previous exception that occurred that caused this exception, if any.

Return values
mixed

Search results