-
Notifications
You must be signed in to change notification settings - Fork 2
AjaxException
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Exceptions\AjaxException is specialized for AJAX request failures with JSON replies.
__construct(string $message, int $code = 0, ?Throwable $previous = null):
- logs error message
- preserves base exception behavior from
PairException
- in production, replaces message with translated generic message
- sends JSON error payload
use Pair\Exceptions\AjaxException;
if (!$isValidRequest) {
AjaxException::reply('Invalid request payload', 2001, 422);
}See also: ApiException, PairException, Controller.