0 | module HTTP.I18n.EN
 1 |
 2 | import HTTP.API.Decode
 3 | import HTTP.RequestErr
 4 | import IO.Async.Logging
 5 | import public HTTP.I18n
 6 |
 7 | %default total
 8 |
 9 | export
10 | HTTPLocal where
11 |   endOfURIPath = "unexpected end of URI path"
12 |   floatingPointNumber = "floating point number"
13 |   integer = "integer"
14 |   invalidPath = "invalid URI path"
15 |   jsonValue = "JSON value"
16 |   logLevel = interpolate
17 |   missingBoundary = "invalid form-data header: missing boundary"
18 |   missingFormDataPart p ps = "missing form-data part: \{p} (parts: \{ps})"
19 |   missingHeader h = "missing HTTP header: \{h}"
20 |   missingQueryParameter n = "missing query parameter: '\{n}'"
21 |   missingQueryValue n = "missing query value: '\{n}'"
22 |   myMediaTypeNotAccepted x y = "i provide \{x} but requests accepts only \{y}"
23 |   unsignedInteger = "unsigned integer"
24 |   naturalNumber = "natural number"
25 |   outOfBounds a b =
26 |     "Value out of bounds. It should be between \{show a} and \{show b}."
27 |
28 |   prettyRequestErr (RE s e m d p) =
29 |     """
30 |     Error Details:
31 |     status  : \{show s}
32 |     error   : \{e}
33 |     message : \{m}
34 |     details : \{d}
35 |     path    : \{p}
36 |     """
37 |
38 |   prettyDecodeErr (ReadErr t s d) = "invalid \{t}\{valueString s}"
39 |   prettyDecodeErr (ContentErr t d) = "invalid \{t}"
40 |   prettyDecodeErr (Msg msg) = msg
41 |