Skip to content
Snippets Groups Projects
Commit 56fd1b60 authored by catch's avatar catch
Browse files

Issue #3086408 by Krzysztof Domański, mglaman, el7cosmos: Error code should be...

Issue #3086408 by Krzysztof Domański, mglaman, el7cosmos: Error code should be string in HttpExceptionNormalizer
parent 44416f1c
Branches
Tags
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
......@@ -87,7 +87,7 @@ protected function buildErrorObjects(HttpException $exception) {
// Exceptions thrown without an explicitly defined code get assigned zero by
// default. Since this is no helpful information, omit it.
if ($exception->getCode() !== 0) {
$error['code'] = $exception->getCode();
$error['code'] = (string) $exception->getCode();
}
if ($this->currentUser->hasPermission('access site reports')) {
// The following information may contain sensitive information. Only show
......
......@@ -36,8 +36,8 @@ public function testNormalize() {
$error = $normalized[0];
$this->assertNotEmpty($error['meta']);
$this->assertNotEmpty($error['source']);
$this->assertEquals(13, $error['code']);
$this->assertEquals(403, $error['status']);
$this->assertSame('13', $error['code']);
$this->assertSame('403', $error['status']);
$this->assertEquals('Forbidden', $error['title']);
$this->assertEquals('lorem', $error['detail']);
$this->assertArrayHasKey('trace', $error['meta']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment