diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
index e0a1343..2ed5176 100644
--- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
@@ -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);
diff --git a/core/modules/rest/src/Tests/AuthTest.php b/core/modules/rest/src/Tests/AuthTest.php
index 09537c8..c222b26 100644
--- a/core/modules/rest/src/Tests/AuthTest.php
+++ b/core/modules/rest/src/Tests/AuthTest.php
@@ -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);
