blob: 581bb2404f89933e4bc3bd013061651e2591be47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
module Error exposing (Type, Mode(..), new, to_string)
type Mode =
IllegalAction
| Programming
type alias Type =
{
mode: Mode,
message: String
}
new : Mode -> String -> Type
new mode str =
{
mode = mode,
message = str
}
to_string : Type -> String
to_string e =
(
(case e.mode of
IllegalAction -> "Request discarded: "
Programming -> "Error in the program (please report): "
)
++ e.message
)
|