You are here

public function UpdateTestController::updateError in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php \Drupal\update_test\Controller\UpdateTestController::updateError()

Displays an Error 503 (Service unavailable) page.

Return value

\Symfony\Component\HttpFoundation\Response Returns the response with a special header.

1 string reference to 'UpdateTestController::updateError'
update_test.routing.yml in core/modules/update/tests/modules/update_test/update_test.routing.yml
core/modules/update/tests/modules/update_test/update_test.routing.yml

File

core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php, line 20

Class

UpdateTestController
Provides different routes of the update_test module.

Namespace

Drupal\update_test\Controller

Code

public function updateError() {
  $response = new Response();
  $response
    ->setStatusCode(503);
  $response->headers
    ->set('Status', '503 Service unavailable');
  return $response;
}