mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-17 23:18:28 +01:00
- prevented crash when sending message to command did not worked.
Printing error to command line instead.
This commit is contained in:
parent
51b3167bfd
commit
b37c590265
@ -1186,6 +1186,7 @@
|
||||
:colorized-line->tui-string
|
||||
:standard-error-notify-life
|
||||
:with-notify-errors
|
||||
:with-print-error-message
|
||||
:make-tui-char
|
||||
:make-tui-string))
|
||||
|
||||
|
@ -1384,7 +1384,8 @@
|
||||
(defmethod process-event ((object send-to-pipe-event))
|
||||
(with-accessors ((data data)
|
||||
(command command)) object
|
||||
(os-utils:send-to-pipe data command)))
|
||||
(tui:with-print-error-message
|
||||
(os-utils:send-to-pipe data command))))
|
||||
|
||||
;;;; general usage
|
||||
|
||||
|
@ -398,3 +398,11 @@ latter has a length equals to `total-size'"))
|
||||
(ui:notify (format nil (_ "Error: ~a") e)
|
||||
:life (* (swconf:config-notification-life) 5)
|
||||
:as-error t))))
|
||||
|
||||
(defmacro with-print-error-message (&body body)
|
||||
#+debug-mode `(progn ,@body)
|
||||
#-debug-mode `(handler-case
|
||||
(progn
|
||||
,@body)
|
||||
(error (e)
|
||||
(ui:error-message (format nil (_ "Error: ~a") e)))))
|
||||
|
Loading…
Reference in New Issue
Block a user