-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update: 支持设置全局错误&异常处理器 * Update: 更新文档 * Update: 更新文档
- Loading branch information
Showing
5 changed files
with
138 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Imi\Log; | ||
|
||
abstract class AbstractErrorEventHandler implements IErrorEventHandler | ||
{ | ||
private bool $stopPropagation = false; | ||
|
||
/** | ||
* 是否取消系统内部的错误域异常处理并停止后续处理器执行. | ||
*/ | ||
public function isPropagationStopped(): bool | ||
{ | ||
return $this->stopPropagation; | ||
} | ||
|
||
/** | ||
* 取消系统内部的错误域异常处理并停止后续处理器执行. | ||
*/ | ||
public function stopPropagation(bool $stop = true): void | ||
{ | ||
$this->stopPropagation = $stop; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Imi\Log; | ||
|
||
interface IErrorEventHandler | ||
{ | ||
public function isPropagationStopped(): bool; | ||
|
||
/** | ||
* 取消系统内部的错误域异常处理并停止后续处理器执行. | ||
*/ | ||
public function stopPropagation(bool $stop = true): void; | ||
|
||
public function handleError(int $errNo, string $errStr, string $errFile, int $errLine): void; | ||
|
||
public function handleException(\Throwable $throwable): void; | ||
} |