File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed
Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 44
55- Enh #150 : Cleanup templates, remove legacy code (@vjik )
66- New #151 : Add ` $traceLink ` parameter to ` HtmlRenderer ` to allow linking to trace files (@vjik )
7+ - New #152 : Add ` UserExceptionInterface ` to mark user exceptions (@vjik )
78
89## 4.1.0 April 18, 2025
910
Original file line number Diff line number Diff line change 77use Exception ;
88
99/**
10- * UserException is the base class for exceptions that are meant to be shown to end users.
11- * Such exceptions are often caused by mistakes of end users.
10+ * `UserException` represents an exception that is meant to be shown to end users.
1211 *
1312 * @final
1413 */
15- class UserException extends Exception
14+ class UserException extends Exception implements UserExceptionInterface
1615{
1716}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Yiisoft \ErrorHandler \Exception ;
6+
7+ use Throwable ;
8+
9+ /**
10+ * Interface for exceptions that are meant to be shown to end users.
11+ * Such exceptions are often caused by mistakes of end users.
12+ */
13+ interface UserExceptionInterface extends Throwable
14+ {
15+ }
Original file line number Diff line number Diff line change 11<?php
22
3- use Yiisoft \ErrorHandler \Exception \UserException ;
3+ use Yiisoft \ErrorHandler \Exception \UserExceptionInterface ;
44use Yiisoft \ErrorHandler \Renderer \HtmlRenderer ;
55use Yiisoft \ErrorHandler \ThrowableRendererInterface ;
66
99 * @var HtmlRenderer $this
1010 */
1111
12- if ($ throwable instanceof UserException ) {
12+ if ($ throwable instanceof UserExceptionInterface ) {
1313 $ name = $ this ->getThrowableName ($ throwable );
1414 $ message = $ throwable ->getMessage ();
1515} else {
You can’t perform that action at this time.
0 commit comments