metar-0.0.5: METAR from BOM (Australia) with NOAA fallback
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aviation.Metar.METARError

Description

A single failure during METAR lookup, tagged with the source (which BOM state or which upstream API) and either a connection failure or a parse-level reason.

Synopsis

Documentation

data METARError Source #

Description of one thing that went wrong at one source.

>>> connError "NOAA" (ErrorMisc "boom")
ConnErrorAt "NOAA" (ErrorMisc "boom")
>>> parseError "New-South-Wales" "not found"
ParseErrorAt "New-South-Wales" "not found"

Constructors

ConnErrorAt String ConnError

Network failure at the named source.

ParseErrorAt String String

Non-network failure at the named source, e.g. HTTP 404 or ICAO absent from the response.

Instances

Instances details
Show METARError Source # 
Instance details

Defined in Data.Aviation.Metar.METARError

Eq METARError Source # 
Instance details

Defined in Data.Aviation.Metar.METARError

connError :: String -> ConnError -> METARError Source #

Build a ConnErrorAt.

>>> connError "BOM" (ErrorMisc "response timeout")
ConnErrorAt "BOM" (ErrorMisc "response timeout")

parseError :: String -> String -> METARError Source #

Build a ParseErrorAt.

>>> parseError "NOAA" "HTTP 404"
ParseErrorAt "NOAA" "HTTP 404"