modifs.mineures sans commentaires
This commit is contained in:
parent
a46111d089
commit
0cd7db166f
|
@ -419,7 +419,13 @@ class StdMessenger implements _IMessenger {
|
||||||
$showTraceback = $this->checkLevel($level1);
|
$showTraceback = $this->checkLevel($level1);
|
||||||
foreach ($exceptions as $exception) {
|
foreach ($exceptions as $exception) {
|
||||||
# tout d'abord userMessage
|
# tout d'abord userMessage
|
||||||
$userMessage = UserException::get_user_message($exception);
|
if ($exception instanceof UserException) {
|
||||||
|
$userMessage = UserException::get_user_message($exception);
|
||||||
|
$showSummary = true;
|
||||||
|
} else {
|
||||||
|
$userMessage = UserException::get_summary($exception);
|
||||||
|
$showSummary = false;
|
||||||
|
}
|
||||||
if ($userMessage !== null && $showContent) {
|
if ($userMessage !== null && $showContent) {
|
||||||
if ($printActions) { $this->printActions(); $printActions = false; }
|
if ($printActions) { $this->printActions(); $printActions = false; }
|
||||||
$this->_printGeneric($linePrefix, $level, $type, $userMessage, $indentLevel, $out);
|
$this->_printGeneric($linePrefix, $level, $type, $userMessage, $indentLevel, $out);
|
||||||
|
@ -427,9 +433,11 @@ class StdMessenger implements _IMessenger {
|
||||||
# puis summary et traceback
|
# puis summary et traceback
|
||||||
if ($showTraceback) {
|
if ($showTraceback) {
|
||||||
if ($printActions) { $this->printActions(); $printActions = false; }
|
if ($printActions) { $this->printActions(); $printActions = false; }
|
||||||
$summary = UserException::get_summary($exception);
|
if ($showSummary) {
|
||||||
|
$summary = UserException::get_summary($exception);
|
||||||
|
$this->_printGeneric($linePrefix, $level1, $type, $summary, $indentLevel, $out);
|
||||||
|
}
|
||||||
$traceback = UserException::get_traceback($exception);
|
$traceback = UserException::get_traceback($exception);
|
||||||
$this->_printGeneric($linePrefix, $level1, $type, $summary, $indentLevel, $out);
|
|
||||||
$this->_printGeneric($linePrefix, $level1, $type, $traceback, $indentLevel, $out);
|
$this->_printGeneric($linePrefix, $level1, $type, $traceback, $indentLevel, $out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,12 +235,12 @@ Application::run(new class extends Application {
|
||||||
|
|
||||||
msg::section("Exceptions", function ($msg) {
|
msg::section("Exceptions", function ($msg) {
|
||||||
$e = new Exception("message");
|
$e = new Exception("message");
|
||||||
$u1 = new UserException("userMessage");
|
$u1 = new UserException("userMessage1");
|
||||||
$u2 = new UserException("userMessage", "techMessage");
|
$u2 = new UserException("userMessage2", "techMessage2");
|
||||||
$msg->title("avec message", function ($msg) use ($e, $u1, $u2) {
|
$msg->title("avec message", function ($msg) use ($e, $u1, $u2) {
|
||||||
$msg->info(["exception", $e]);
|
$msg->info(["exception message", $e]);
|
||||||
$msg->info(["userException1", $u1]);
|
$msg->info(["userException1 message", $u1]);
|
||||||
$msg->info(["userException2", $u2]);
|
$msg->info(["userException2 message", $u2]);
|
||||||
});
|
});
|
||||||
$msg->title("sans message", function ($msg) use ($e, $u1, $u2) {
|
$msg->title("sans message", function ($msg) use ($e, $u1, $u2) {
|
||||||
$msg->info($e);
|
$msg->info($e);
|
||||||
|
|
Loading…
Reference in New Issue