yesod-auth-oauth2/src/Yesod/Auth/OAuth2/Exception.hs
2023-08-01 10:37:16 -04:00

27 lines
692 B
Haskell

{-# LANGUAGE DeriveDataTypeable #-}
module Yesod.Auth.OAuth2.Exception
( YesodOAuth2Exception (..)
) where
import Control.Exception.Safe
import Data.ByteString.Lazy (ByteString)
import Data.Text (Text)
data YesodOAuth2Exception
= -- | HTTP error during OAuth2 handshake
--
-- Plugin name and JSON-encoded @OAuth2Error@ from @hoauth2@.
OAuth2Error Text ByteString
| -- | User profile was not as expected
--
-- Plugin name and Aeson parse error message.
JSONDecodingError Text String
| -- | Other error conditions
--
-- Plugin name and error message.
GenericError Text String
deriving (Show, Typeable)
instance Exception YesodOAuth2Exception