for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DansMaCulotte\Newsletter\Exceptions;
use Exception;
use Throwable;
/**
* Class ApiError
* @package DansMaCulotte\Newsletter\Exceptions;
*/
class ApiError extends Exception
{
* @param string $error
* @param string $name
* @param int $code
* @param Throwable|null $previous
* @return ApiError
public static function responseError(string $error, string $name, $code = 0, Throwable $previous = null)
return new static("{$name} returned an error: {$error}", $code, $previous);
}