mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX: Remove shutdown function for error output (fixes #204)
This commit is contained in:
parent
3be003218c
commit
ff9127739b
@ -111,8 +111,6 @@ class HTTPBulkToolsResponse extends HTTPResponse
|
|||||||
$this->removesRows = $removesRows;
|
$this->removesRows = $removesRows;
|
||||||
$this->gridField = $gridfield;
|
$this->gridField = $gridfield;
|
||||||
|
|
||||||
register_shutdown_function(array($this, 'shutdown'));
|
|
||||||
|
|
||||||
parent::__construct(null, $statusCode);
|
parent::__construct(null, $statusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,18 +360,4 @@ class HTTPBulkToolsResponse extends HTTPResponse
|
|||||||
$this->createBody();
|
$this->createBody();
|
||||||
parent::outputBody();
|
parent::outputBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Catches fatal PHP error and output something useful for the front end
|
|
||||||
*/
|
|
||||||
public function shutdown()
|
|
||||||
{
|
|
||||||
$error = error_get_last();
|
|
||||||
if ($error !== null ) {
|
|
||||||
$this->setMessage($error['message']);
|
|
||||||
$this->setStatusCode(500, $error['message']);
|
|
||||||
$this->outputBody();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user