Skip to content

Commit 5a660bc

Browse files
committed
improve error message
1 parent 5bfd5a4 commit 5a660bc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Applib/Show.juvix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Applib.Show;
22

33
import Stdlib.Prelude open;
4+
import Stdlib.Debug.Fail open;
45
import Stdlib.Math open;
56

67
--- non-builtin equivalent of ;natToString;
@@ -19,7 +20,7 @@ recursiveNatToString (n : Nat) : String :=
1920
| d == 7 := "7"
2021
| d == 8 := "8"
2122
| d == 9 := "9"
22-
| else := "impossible";
23+
| else := failwith "impossible";
2324
in if
2425
| n < 10 := showDigit n
2526
| else := recursiveNatToString (div n 10) ++ showDigit (mod n 10);

BaseLayer/ResourceMachine.juvix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ with
258258
(ByteArray.toList b ++ replicate (sub size numBytes) 0))
259259
| else :=
260260
failwith
261-
"NullifierKeyCommitment.fromByteArray expects a ByteArray of at most 32 bytes";
261+
("NullifierKeyCommitment.fromByteArray expects a ByteArray of at most 32 bytes. Was given a ByteArray of length " ++ recursiveNatToString numBytes);
262262

263263
toAnomaAtom : NullifierKeyCommitment -> AnomaAtom :=
264264
toByteArray >> toAnomaContents;

0 commit comments

Comments
 (0)