summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2025-02-14 23:33:05 +0100
committerW. Kosior <koszko@koszko.org>2025-02-14 23:33:05 +0100
commit9d402bf015184ae06021d06b25222fba65c8b61c (patch)
treeb007605d54c94013e33a99e61b69bed852d2d4d8
parent616c73f178e81fe30fc27b0dc2fffc29d7c18428 (diff)
downloadcantius-9d402bf015184ae06021d06b25222fba65c8b61c.tar.gz
cantius-9d402bf015184ae06021d06b25222fba65c8b61c.zip
Use format's tilde+newline sequence to break long strings.
Some might argue it is better to just keep long strings in the source code, for readability. But this is not that readable when, e.g., editing the code in a narrow Emacs window.
-rw-r--r--src/guile/cantius.scm27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/guile/cantius.scm b/src/guile/cantius.scm
index 9fe9884..517c75f 100644
--- a/src/guile/cantius.scm
+++ b/src/guile/cantius.scm
@@ -199,7 +199,9 @@
(raise (s35:condition
(&bad-request)
(s35:&message
- (message "Last boundary in multipart/form-data should end with extra double hyphen followed by CRLF")))))
+ (message (format #f "Last boundary in multipart/form-data ~
+ should end with extra double hyphen ~
+ followed by CRLF"))))))
;; Discard the last "part" (actually, the epilogue).
(reverse parts))
@@ -230,7 +232,10 @@
(&condition-with-http-code
(http-code 415)) ;; Unsupported Media Type
(s35:&message
- (message (format #f "Content-Transfer-Encoding of type \"~a\" is not currently supported for multipart/form-data parts, please use \"binary\" instead"
+ (message (format #f "Content-Transfer-Encoding of type ~
+ \"~a\" is not currently supported ~
+ for multipart/form-data parts, ~
+ please use \"binary\" instead"
content-transfer-encoding))))))
(form-data-part
@@ -334,7 +339,8 @@
(make-handler-parameter 403 "You. Shall not. Pass. (forbidden)"))
(define-public %bad-request-handler
- (make-handler-parameter 400 "Bad Request (you or your software seems to have messed sth up)."))
+ (make-handler-parameter 400 (format #f "Bad Request (you or your software ~
+ seems to have messed sth up).")))
(define-public %default-handler
(let ((not-found-handler (%not-found-handler)))
@@ -387,13 +393,15 @@
(raise (s35:condition
(s35:&error)
(s35:&message
- (message (format #f "Endpoint already registered for ~s"
+ (message (format #f "Endpoint already registered for ~
+ ~s"
path))))))
((and (endset? what) (not (s146:mapping-empty? children)))
(raise (s35:condition
(s35:&error)
(s35:&message
- (message (format #f "Endpoints already registered under ~s"
+ (message (format #f "Endpoints already registered ~
+ under ~s"
path))))))
(#t
(endpoint-tree-node
@@ -405,13 +413,15 @@
(raise (s35:condition
(s35:&error)
(s35:&message
- (message (format #f "\"any\" endpoint already registered for ~s"
+ (message (format #f "\"any\" endpoint already ~
+ registered for ~s"
path))))))
((endset? what)
(raise (s35:condition
(s35:&error)
(s35:&message
- (message (format #f "endset should be registered at normal path, not ~s"
+ (message (format #f "endset should be registered at ~
+ normal path, not ~s"
path))))))
(#t
(endpoint-tree-node
@@ -455,7 +465,8 @@
(raise (s35:condition
(s35:&error)
(s35:&message
- (message "Binding identifiers to path segments not yet supported")))))
+ (message (format #f "Binding identifiers to path segments ~
+ not yet supported"))))))
(((unquote segment-expression) . rest)
(loop (cons #',segment-expression path-segments) #'rest))
(((unquote-splicing segments-expression) . rest)