Skip to content

@throws <classname> #12

@purencool

Description

@purencool

Set an error exception class an example

Documentation

/**
 *      
 * @throws PurencoolSearchException
 */

PHP provides a Throwable interface, which is implemented by pretty much every type of error that can arise from a PHP application (see https://www.php.net/manual/en/class.throwable.php)

Example

try {
// Code that may throw an Exception or Error.
} catch (Throwable $t) {
// Executed only in PHP 7, will not match in PHP 5.x
} catch (Exception $e) {
// Executed only in PHP 5.x, will not be reached in PHP 7
}
interface MyPackageThrowable extends Throwable {}
class MyPackageException extends Exception implements MyPackageThrowable {}
throw new MyPackageException();

https://stackify.com/php-try-catch-php-exception-tutorial/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions