hq-json-0.1.1: src/HQ/Error.hs
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | Every error hq can report, with per-domain precise types.
module HQ.Error where
import HQ.JSON.Decoder.Error (DecodeError (..), renderDecodeError)
import HQ.Runner.Error (RunnerError (..), renderRunnerError)
import HQ.Transformation.Error (TransformationError (..), renderTransformationError)
import Relude hiding (Compose, id, many, some, state)
data HQError
= HQDecodeError DecodeError
| HQTransformationError TransformationError
| HQRunnerError RunnerError
-- | Render an error for the CLI boundary; nothing else renders errors.
renderHQError :: HQError -> Text
renderHQError err = case err of
HQDecodeError e -> renderDecodeError e
HQTransformationError e -> renderTransformationError e
HQRunnerError e -> renderRunnerError e