class Exceptions extends Exception (View source)

This GenericDatabase\Helpers\Exceptions class is a custom exception that extends the built-in Exception class in PHP. It allows for the creation of custom exceptions with a default message, code, and previous exception.

Example Usage:

$exception = new Exceptions("This is a custom exception", 500);
throw $exception;

Methods:

  • __construct($message = "Custom Exception", $code = 0, Throwable $previous = null): Constructor method that sets the exception message, code, and previous exception using the parent constructor from the Exception class.

Methods

__construct(string $message = "Exception", int $code = 0, Throwable|null $previous = null)

Constructor method for Exceptions

Details

__construct(string $message = "Exception", int $code = 0, Throwable|null $previous = null)

Constructor method for Exceptions

Parameters

string $message

The exception message

int $code

The exception code

Throwable|null $previous

The previous exception