mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
ui: Render MIME parsing errors
This commit is contained in:
@@ -18,6 +18,7 @@ type alias Message =
|
||||
, text : String
|
||||
, html : String
|
||||
, attachments : List Attachment
|
||||
, errors : List Error
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +29,13 @@ type alias Attachment =
|
||||
}
|
||||
|
||||
|
||||
type alias Error =
|
||||
{ name : String
|
||||
, detail : String
|
||||
, severe : Bool
|
||||
}
|
||||
|
||||
|
||||
decoder : Decoder Message
|
||||
decoder =
|
||||
succeed Message
|
||||
@@ -42,6 +50,7 @@ decoder =
|
||||
|> required "text" string
|
||||
|> required "html" string
|
||||
|> required "attachments" (list attachmentDecoder)
|
||||
|> required "errors" (list errorDecoder)
|
||||
|
||||
|
||||
attachmentDecoder : Decoder Attachment
|
||||
@@ -50,3 +59,11 @@ attachmentDecoder =
|
||||
|> required "id" string
|
||||
|> required "filename" string
|
||||
|> required "content-type" string
|
||||
|
||||
|
||||
errorDecoder : Decoder Error
|
||||
errorDecoder =
|
||||
succeed Error
|
||||
|> required "name" string
|
||||
|> required "detail" string
|
||||
|> required "severe" bool
|
||||
|
||||
Reference in New Issue
Block a user