servant-checked-exceptions-0.1.0.0: Checked exceptions for Servant APIs.
Servant.Checked.Exceptions.Internal.Servant.API
Synopsis
data Throws e Source #
Throws is used in Servant API definitions and signifies that an API will throw the given error.
Throws
Here is an example of how to create an API that potentially returns a String as an error, or an Int on success:
String
Int
>>> import Servant.API (Get, JSON, (:>)) >>> type API = Throws String :> Get '[JSON] Int
>>>
import Servant.API (Get, JSON, (:>))
type API = Throws String :> Get '[JSON] Int
Instances
data Throwing e Source #
This is used internally and should not be used by end-users.