Skip to content

Commit 7434790

Browse files
authored
Merge pull request #18 from nazg-hack/hotfix/wrong-types
fixed wrong types
2 parents 252d39e + 942b76f commit 7434790

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/Foundation/Exception/ExceptionHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ protected function toImmMap(\Exception $e): ExceptionImmMap {
5959
'line' => $e->getLine(),
6060
'trace' => map(
6161
$e->getTrace(),
62-
$v ==> (new Map($v))->removeKey('args')->toArray(),
62+
$v ==> {
63+
if(is_array($v)) {
64+
return (new Map($v))->removeKey('args')->toArray();
65+
}
66+
return [];
67+
}
6368
),
6469
],
6570
);

tests/Action/ParameterAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?hh
1+
<?hh // decl
22

33
namespace NazgTest\Action;
44

tests/Exception/ExceptionHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public function testFunctionalExceptionRegister(): void {
3535
$d = json_decode($r->getBody()->getContents(), true);
3636
expect($d['message'])->toBeSame('Exception for testing');
3737
expect($r->getStatusCode())->toBeSame(500);
38+
$this->assertArrayHasKey('exception', $d);
39+
$this->assertArrayHasKey('file', $d);
40+
$this->assertArrayHasKey('line', $d);
41+
$this->assertArrayHasKey('trace', $d);
3842
}
3943
}
4044
}

0 commit comments

Comments
 (0)