| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace Opentalent\OtTemplating\Exception;
- use Exception;
- /**
- * Class ApiRequestException
- *
- * An ApiRequestException is raised when a request to the
- * Opentalent Api did not return a valid answer.
- *
- * @package Opentalent\OtTemplating\Exception
- */
- class ApiRequestException extends Exception
- {
- /**
- * ApiRequestException constructor.
- *
- * @param $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null) {
- parent::__construct($message, $code, $previous);
- }
- /**
- * Construction from other exception
- *
- * @param Exception $e
- * @return ApiRequestException
- */
- public static function from_exception(Exception $e) {
- return new ApiRequestException($e->getMessage(), $e->getCode(), $e->getPrevious());
- }
- }
|