aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html
diff options
context:
space:
mode:
Diffstat (limited to 'module/calp/html')
-rw-r--r--module/calp/html/components.scm5
-rw-r--r--module/calp/html/util.scm1
-rw-r--r--module/calp/html/view/calendar.scm4
3 files changed, 7 insertions, 3 deletions
diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm
index 2f8c85ec..37d50697 100644
--- a/module/calp/html/components.scm
+++ b/module/calp/html/components.scm
@@ -57,7 +57,10 @@
allow-other-keys:
rest: args)
(when (and onclick href)
- (error "Only give one of onclick, href and submit."))
+ (scm-error 'wrong-type-arg "btn"
+ "href, onclick, and submit mutually exclusive. href = ~s, onclick = ~s, submit = ~s."
+ (list href onclick submit)
+ #f))
(let ((body #f))
`(,(cond [href 'a]
diff --git a/module/calp/html/util.scm b/module/calp/html/util.scm
index 75137d4e..54c92e92 100644
--- a/module/calp/html/util.scm
+++ b/module/calp/html/util.scm
@@ -17,6 +17,7 @@
;; Returns a color with good contrast to the given background color.
;; https://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color/1855903#1855903
(define-public (calculate-fg-color c)
+ ;; TODO what errors can actually appear here?
(catch #t
(lambda ()
(define (str->num c n) (string->number (substring/shared c n (+ n 2)) 16))
diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm
index 670ad9b6..5a8e977e 100644
--- a/module/calp/html/view/calendar.scm
+++ b/module/calp/html/view/calendar.scm
@@ -74,10 +74,10 @@
,display)))
(unless next-start
- (error 'html-generate "Next-start needs to be a procedure"))
+ (scm-error 'misc-error "html-generate" "Next-start needs to be a procedure" #f #f))
(unless prev-start
- (error 'html-generate "Prev-start needs to be a procedure"))
+ (scm-error 'misc-error "html-generate" "Prev-start needs to be a procedure" #f #f))
(xhtml-doc
(@ (lang sv))