[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 05/06: shepherd: Better report key&args exceptions from confi
From: |
Ludovic Courtès |
Subject: |
[shepherd] 05/06: shepherd: Better report key&args exceptions from config file loading. |
Date: |
Wed, 8 May 2024 19:34:39 -0400 (EDT) |
civodul pushed a commit to branch devel
in repository shepherd.
commit 28f69f5c0ab8704fcf3b83e6f7746b0800d66f47
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed May 8 18:05:59 2024 +0200
shepherd: Better report key&args exceptions from config file loading.
* modules/shepherd.scm
(configuration-file-loader)[handle-key-and-args-exception]:
Use ‘print-exception’ unconditionally to report the error.
---
modules/shepherd.scm | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 0519418..f7e302b 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -167,15 +167,13 @@ using fallback mechanism."))
#f)
(define (handle-key-and-args-exception key args)
- (match key
- ('system-error
- (local-output
- (l10n "While loading configuration file '~a': ~a")
- file (strerror (system-error-errno (cons key args)))))
- (_
- (local-output
- (l10n "Uncaught exception while loading configuration file '~a': ~s")
- file (cons key args)))))
+ (local-output
+ (l10n "While loading configuration file '~a': ~s")
+ file
+ (string-trim-right
+ (call-with-output-string
+ (lambda (port)
+ (print-exception port #f key args))))))
(lambda ()
(guard (c ((action-runtime-error? c)
- [shepherd] branch devel updated (e6e9fdf -> c6f97c6), Ludovic Courtès, 2024/05/08
- [shepherd] 01/06: timer: #:days-of-week is now a symbol., Ludovic Courtès, 2024/05/08
- [shepherd] 03/06: herd: Add ‘--log-history’ option., Ludovic Courtès, 2024/05/08
- [shepherd] 02/06: timer: Out-of-range error message is localized., Ludovic Courtès, 2024/05/08
- [shepherd] 06/06: service: ‘stop-service’ raises ‘&action-runtime-error’., Ludovic Courtès, 2024/05/08
- [shepherd] 05/06: shepherd: Better report key&args exceptions from config file loading.,
Ludovic Courtès <=
- [shepherd] 04/06: shepherd: Remove extra newline in error message., Ludovic Courtès, 2024/05/08