1
0
Fork 0

- prevented crash when sending message to command did not worked.

Printing error to command line instead.
This commit is contained in:
cage 2021-02-02 20:44:18 +01:00
parent 51b3167bfd
commit b37c590265
3 changed files with 11 additions and 1 deletions

View File

@ -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))

View File

@ -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

View File

@ -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)))))