Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
12345678910111213141516171819202122232425262728293031323334<?php
final class PhabricatorConduitRequestExceptionHandler extends PhabricatorRequestExceptionHandler {
public function getRequestExceptionHandlerPriority() { return 100000; }
public function getRequestExceptionHandlerDescription() { return pht('Responds to requests made by Conduit clients.'); }
public function canHandleRequestThrowable( AphrontRequest $request, $throwable) { return $request->isConduit(); }
public function handleRequestThrowable( AphrontRequest $request, $throwable) {
$response = id(new ConduitAPIResponse()) ->setErrorCode(get_class($throwable)) ->setErrorInfo($throwable->getMessage());
return id(new AphrontJSONResponse()) ->setAddJSONShield(false) ->setContent($response->toDictionary()); }
}