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
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment