Skip to content

Commit 7aea1d8

Browse files
authored
Fix #55: Defer exit on terminate
1 parent 57074e8 commit 7aea1d8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Yii Error Handler Change Log
22

3-
## 2.0.3 under development
3+
## 2.1.0 under development
44

5-
- no changes in this release.
5+
- Enh #55: Defer exit on terminate (rustamwin)
66

77
## 2.0.2 February 04, 2022
88

src/ErrorHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ private function renderThrowableAndTerminate(Throwable $t): void
160160
http_response_code(Status::INTERNAL_SERVER_ERROR);
161161

162162
echo $this->handle($t);
163-
exit(1);
163+
register_shutdown_function(static function (): void {
164+
exit(1);
165+
});
164166
}
165167
}

0 commit comments

Comments
 (0)