Skip to content

Commit 4348552

Browse files
committed
slight changes in error messages
1 parent 75a1dc9 commit 4348552

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/arr/trove/error.arr

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,8 +2446,8 @@ data RuntimeError:
24462446
ED.highlight(ED.text("unit"), [ED.locs: ast.l], 0),
24472447
ED.text(" annotated a "),
24482448
ED.highlight(ED.text("base type"), [ED.locs: ast.ann.l], 1),
2449-
ED.text(" which does not support units.")]]
2450-
| none =>
2449+
ED.text(" which does not support units. Consider removing the unit annotation or changing the base type.")]]
2450+
| none =>
24512451
[ED.error:
24522452
ed-intro("unit annotation", self.loc, -1, true),
24532453
ED.cmcode(self.loc),
@@ -2517,7 +2517,7 @@ data RuntimeError:
25172517
| none => default-err-msg
25182518
end
25192519
else:
2520-
default-err-msg
2520+
base-err-msg
25212521
end
25222522
| none =>
25232523
[ED.sequence:
@@ -2550,6 +2550,13 @@ data RuntimeError:
25502550
end
25512551
| invalid-unit-state(opname, n, desc) with:
25522552
method render-fancy-reason(self, maybe-stack-loc, src-available, maybe-ast):
2553+
base-err-msg = [ED.sequence:
2554+
[ED.para:
2555+
ED.text("The " + self.opname + " function failed.")],
2556+
[ED.para:
2557+
ED.code(ED.text(tostring(self.n))),
2558+
ED.text(" is an invalid argument because: "),
2559+
ED.text(self.desc)]]
25532560
[ED.error:
25542561
cases(O.Option) maybe-stack-loc(0, false):
25552562
| some(loc) =>
@@ -2569,15 +2576,10 @@ data RuntimeError:
25692576
ED.code(ED.text(tostring(self.n))),
25702577
ED.text(" is an invalid argument because: "),
25712578
ED.text(self.desc)]]
2579+
else:
2580+
base-err-msg
25722581
end
2573-
| none =>
2574-
[ED.sequence:
2575-
[ED.para:
2576-
ED.text("The " + self.opname + " function failed.")],
2577-
[ED.para:
2578-
ED.code(ED.text(tostring(self.n))),
2579-
ED.text(" is an invalid argument because: "),
2580-
ED.text(self.desc)]]
2582+
| none => base-err-msg
25812583
end]
25822584
end,
25832585
method render-reason(self):

0 commit comments

Comments
 (0)