Page MenuHomePhorge

PhabricatorAjaxRequestExceptionHandler.php
No OneTemporary

Size
940 B
Referenced Files
None
Subscribers
None

PhabricatorAjaxRequestExceptionHandler.php

<?php
final class PhabricatorAjaxRequestExceptionHandler
extends PhabricatorRequestExceptionHandler {
public function getRequestExceptionHandlerPriority() {
return 110000;
}
public function getRequestExceptionHandlerDescription() {
return pht('Responds to requests made by AJAX clients.');
}
public function canHandleRequestThrowable(
AphrontRequest $request,
$throwable) {
// For non-workflow requests, return a Ajax response.
return ($request->isAjax() && !$request->isWorkflow());
}
public function handleRequestThrowable(
AphrontRequest $request,
$throwable) {
// Log these; they don't get shown on the client and can be difficult
// to debug.
phlog($throwable);
$response = new AphrontAjaxResponse();
$response->setError(
array(
'code' => get_class($throwable),
'info' => $throwable->getMessage(),
));
return $response;
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, May 5, 6:59 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70442
Default Alt Text
PhabricatorAjaxRequestExceptionHandler.php (940 B)

Event Timeline