Skip to content

Commit

Permalink
Merge pull request #21 from 40ants/handle-serious-condition
Browse files Browse the repository at this point in the history
Support serious-condition in with-log-unhandled.
  • Loading branch information
svetlyak40wt authored Mar 1, 2024
2 parents 09a7e7d + bd025d2 commit f7012ac
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion qlfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
("ultralisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "http://dist.ultralisp.org/" :%version :latest)
:version "20231128222503"))
:version "20240229052000"))
7 changes: 7 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
"REPL"
"API"
"CL-STRINGS"
"SB-EXT:TIMEOUT"
"CL"
":JSON"
":PLAIN"
"HTTP"
"ASDF"
"TRACEBACK-TO-STRING"))
(0.11.0 2024-03-01
"
## Changed
Macro LOG4CL-EXTRAS/ERROR:WITH-LOG-UNHANDLED now handles SERIOUS-CONDITION instead of ERROR. This is important, because ERROR is not a only subclass of the SERIOUS-CONDITION, for example, SB-EXT:TIMEOUT is inherited directly from SERIOUS-CONDITION and old version of the macro was not able to log such errors.
")
(0.10.0 2023-11-19
"
## New
Expand Down
21 changes: 11 additions & 10 deletions src/error.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,17 @@ how to not log secret values.
(depth *max-traceback-depth*)
(errors-to-ignore nil))
(handler-bind
((error (lambda (condition)
(when (or (null errors-to-ignore)
(notany (curry #'typep condition)
errors-to-ignore))
(let ((tb-as-string
(print-backtrace :stream nil
:condition condition
:depth depth)))
(with-fields (:traceback tb-as-string)
(log:error "Unhandled exception")))))))
((serious-condition
(lambda (condition)
(when (or (null errors-to-ignore)
(notany (curry #'typep condition)
errors-to-ignore))
(let ((tb-as-string
(print-backtrace :stream nil
:condition condition
:depth depth)))
(with-fields (:traceback tb-as-string)
(log:error "Unhandled exception")))))))
(funcall thunk)))


Expand Down

0 comments on commit f7012ac

Please sign in to comment.