Skip to content
Snippets Groups Projects
Commit e6ea4170 authored by Jess's avatar Jess
Browse files

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

parent 07f92ed7
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -159,7 +159,7 @@ protected function onJson(GetResponseForExceptionEvent $event) {
// 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);
......
......@@ -40,7 +40,7 @@ public function testRead() {
// 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment