From 1da5a277188a954d881316cb605962ee66053285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 17 Mar 2022 22:14:18 +0100 Subject: Normalize errors. --- module/crypto.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/crypto.scm') diff --git a/module/crypto.scm b/module/crypto.scm index 79eaaf89..477014e9 100644 --- a/module/crypto.scm +++ b/module/crypto.scm @@ -22,7 +22,9 @@ (define bv (cond ((bytevector? msg) msg) ((string? msg) (string->utf8 msg)) - (else (throw 'value-error "Invalid type")))) + (else (scm-error 'wrong-type-arg "sha256" + "Wrong type argument. Expected string or bytevector, got ~s" + (list msg) (list msg))))) (SHA256 ((@ (system foreign) bytevector->pointer) bv) (bytevector-length bv) ((@ (system foreign) bytevector->pointer) md)) -- cgit v1.2.3