Issue #2486943 by lostkangaroo, Crell, neclimdul: Standardize error message property name

8.0.x
xjm 2015-05-24 22:16:36 -05:00
parent 07f92ed7f5
commit e6ea417035
2 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class DefaultExceptionSubscriber implements EventSubscriberInterface {
// of message to be displayed,
$data = NULL;
if (error_displayable($error) && $message = $exception->getMessage()) {
$data = ['error' => sprintf('A fatal error occurred: %s', $message)];
$data = ['message' => sprintf('A fatal error occurred: %s', $message)];
}
$response = new JsonResponse($data, Response::HTTP_INTERNAL_SERVER_ERROR);

View File

@ -40,7 +40,7 @@ class AuthTest extends RESTTestBase {
// Try to read the resource as an anonymous user, which should not work.
$this->httpRequest($entity->urlInfo(), 'GET', NULL, $this->defaultMimeType);
$this->assertResponse('401', 'HTTP response code is 401 when the request is not authenticated and the user is anonymous.');
$this->assertRaw(json_encode(['error' => 'A fatal error occurred: No authentication credentials provided.']));
$this->assertRaw(json_encode(['message' => 'A fatal error occurred: No authentication credentials provided.']));
// Ensure that cURL settings/headers aren't carried over to next request.
unset($this->curlHandle);