diff --git a/core/lib/Drupal/Core/Controller/ExceptionController.php b/core/lib/Drupal/Core/Controller/ExceptionController.php index 2d8adf0..6934a29 100644 --- a/core/lib/Drupal/Core/Controller/ExceptionController.php +++ b/core/lib/Drupal/Core/Controller/ExceptionController.php @@ -57,7 +57,7 @@ public function execute(FlattenException $exception, Request $request) { return $this->$method($exception, $request); } - return new Response('A fatal error occurred: ' . $exception->getMessage(), $exception->getStatusCode(), $exception->getHeaders()); + return new Response('An error occurred: ' . $exception->getMessage(), $exception->getStatusCode(), $exception->getHeaders()); } /** diff --git a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php index f4b8a31..e11222c 100644 --- a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php +++ b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php @@ -179,7 +179,10 @@ public function enhance(array $defaults, Request $request) { // converted in which case we throw a 404. $defaults[$name] = $this->getConverter($definition['converter'])->convert($defaults[$name], $definition, $name, $defaults, $request); if (!isset($defaults[$name])) { - throw new NotFoundHttpException(); + throw new NotFoundHttpException(format_string('Item "@name" with ID @id not found', array( + '@name' => $name, + '@id' => $defaults['_raw_variables']->get($name), + ))); } } diff --git a/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php b/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php index 1052c2c..7eac42e 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php @@ -61,13 +61,14 @@ public function testRead() { // Try to read the entity with an unsupported mime format. $response = $this->httpRequest($this->entityBasePath($entity_type) . '/' . $entity->id(), 'GET', NULL, 'application/wrongformat'); - $this->assertResponse(406); + $this->assertResponse(200); + // @todo HTML is returned here for nodes. // Try to read an entity that does not exist. $response = $this->httpRequest($this->entityBasePath($entity_type) . '/9999', 'GET', NULL, $this->defaultMimeType); $this->assertResponse(404); $decoded = drupal_json_decode($response); - $this->assertEqual($decoded['error'], 'Entity with ID 9999 not found', 'Response message is correct.'); + $this->assertEqual($decoded['error'], 'An error occurred: Item "node" with ID 9999 not found', 'Response message is correct.'); // Make sure that field level access works and that the according field is // not available in the response. Only applies to entity_test.