feat(JsonResponse): output errorMessages
This commit is contained in:
parent
49ad30f7da
commit
78902e0502
@ -65,7 +65,6 @@ class JsonResponse implements JsonSerializable
|
||||
'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS, DELETE, PUT, PATCH',
|
||||
'Access-Control-Max-Age' => '86400'
|
||||
], $headers);
|
||||
$this->preparedOutput = '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,6 +160,9 @@ class JsonResponse implements JsonSerializable
|
||||
protected function preparedOutput(): JsonResponse
|
||||
{
|
||||
try {
|
||||
if (!empty($GLOBALS['errorMessages'])){
|
||||
$this->mergeInContent(['errorMessages'=>$GLOBALS['errorMessages']]);
|
||||
}
|
||||
json_encode($this->content);
|
||||
} catch (Throwable $th) {
|
||||
$this->code = 500;
|
||||
|
Loading…
x
Reference in New Issue
Block a user