public function createFromException( $exception ) {
if ( $exception instanceof HttpException ) {
// FIXME can HttpException represent 2xx or 3xx responses?
- $response = $this->createHttpError( $exception->getCode(),
- [ 'message' => $exception->getMessage() ] );
+ $response = $this->createHttpError(
+ $exception->getCode(),
+ array_merge(
+ [ 'message' => $exception->getMessage() ],
+ (array)$exception->getErrorData()
+ )
+ );
} else {
$response = $this->createHttpError( 500, [
'message' => 'Error: exception of type ' . get_class( $exception ),