@@ -227,7 +227,7 @@ captured _ = fromText
228-- > server :: Server MyApi
228-- > server :: Server MyApi
229-- > server = getBook
229-- > server = getBook
230−-- > where getBook :: Text -> EitherT (Int, String) IO Book
230+-- > where getBook :: Text -> EitherT ServantErr IO Book
231-- > getBook isbn = ...
231-- > getBook isbn = ...
232instance (KnownSymbol capture, FromText a, HasServer sublayout)
232instance (KnownSymbol capture, FromText a, HasServer sublayout)
233 => HasServer (Capture capture a :> sublayout) where
233 => HasServer (Capture capture a :> sublayout) where
@@ -253,7 +253,7 @@ instance (KnownSymbol capture, FromText a, HasServer sublayout)
254-- The code of the handler will, just like
254-- The code of the handler will, just like
255-- for 'Servant.API.Get.Get', 'Servant.API.Post.Post' and
255-- for 'Servant.API.Get.Get', 'Servant.API.Post.Post' and
256−-- 'Servant.API.Put.Put', run in @EitherT (Int, String) IO ()@.
256+-- 'Servant.API.Put.Put', run in @EitherT ServantErr IO ()@.
257-- The 'Int' represents the status code and the 'String' a message
257-- The 'Int' represents the status code and the 'String' a message
258-- to be returned. You can use 'Control.Monad.Trans.Either.left' to
258-- to be returned. You can use 'Control.Monad.Trans.Either.left' to
259-- painlessly error out if the conditions for a successful deletion
259-- painlessly error out if the conditions for a successful deletion
@@ -329,7 +329,7 @@ instance
329-- | When implementing the handler for a 'Get' endpoint,
329-- | When implementing the handler for a 'Get' endpoint,
330-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Post.Post'
330-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Post.Post'
331-- and 'Servant.API.Put.Put', the handler code runs in the
331-- and 'Servant.API.Put.Put', the handler code runs in the
332−-- @EitherT (Int, String) IO@ monad, where the 'Int' represents
332+-- @EitherT ServantErr IO@ monad, where the 'Int' represents
333-- the status code and the 'String' a message, returned in case of
333-- the status code and the 'String' a message, returned in case of
334-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
334-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
335-- to quickly fail if some conditions are not met.
335-- to quickly fail if some conditions are not met.
@@ -425,7 +425,7 @@ instance
426-- > server :: Server MyApi
426-- > server :: Server MyApi
427-- > server = viewReferer
427-- > server = viewReferer
428−-- > where viewReferer :: Referer -> EitherT (Int, String) IO referer
428+-- > where viewReferer :: Referer -> EitherT ServantErr IO referer
429-- > viewReferer referer = return referer
429-- > viewReferer referer = return referer
430instance (KnownSymbol sym, FromText a, HasServer sublayout)
430instance (KnownSymbol sym, FromText a, HasServer sublayout)
431 => HasServer (Header sym a :> sublayout) where
431 => HasServer (Header sym a :> sublayout) where
@@ -442,7 +442,7 @@ instance (KnownSymbol sym, FromText a, HasServer sublayout)
442-- | When implementing the handler for a 'Post' endpoint,
442-- | When implementing the handler for a 'Post' endpoint,
443-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
443-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
444-- and 'Servant.API.Put.Put', the handler code runs in the
444-- and 'Servant.API.Put.Put', the handler code runs in the
445−-- @EitherT (Int, String) IO@ monad, where the 'Int' represents
445+-- @EitherT ServantErr IO@ monad, where the 'Int' represents
446-- the status code and the 'String' a message, returned in case of
446-- the status code and the 'String' a message, returned in case of
447-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
447-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
448-- to quickly fail if some conditions are not met.
448-- to quickly fail if some conditions are not met.
@@ -523,7 +523,7 @@ instance
523-- | When implementing the handler for a 'Put' endpoint,
523-- | When implementing the handler for a 'Put' endpoint,
524-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
524-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
525-- and 'Servant.API.Post.Post', the handler code runs in the
525-- and 'Servant.API.Post.Post', the handler code runs in the
526−-- @EitherT (Int, String) IO@ monad, where the 'Int' represents
526+-- @EitherT ServantErr IO@ monad, where the 'Int' represents
527-- the status code and the 'String' a message, returned in case of
527-- the status code and the 'String' a message, returned in case of
528-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
528-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
529-- to quickly fail if some conditions are not met.
529-- to quickly fail if some conditions are not met.
@@ -603,7 +603,7 @@ instance
603-- | When implementing the handler for a 'Patch' endpoint,
603-- | When implementing the handler for a 'Patch' endpoint,
604-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
604-- just like for 'Servant.API.Delete.Delete', 'Servant.API.Get.Get'
605-- and 'Servant.API.Put.Put', the handler code runs in the
605-- and 'Servant.API.Put.Put', the handler code runs in the
606−-- @EitherT (Int, String) IO@ monad, where the 'Int' represents
606+-- @EitherT ServantErr IO@ monad, where the 'Int' represents
607-- the status code and the 'String' a message, returned in case of
607-- the status code and the 'String' a message, returned in case of
608-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
608-- failure. You can quite handily use 'Control.Monad.Trans.EitherT.left'
609-- to quickly fail if some conditions are not met.
609-- to quickly fail if some conditions are not met.
@@ -696,7 +696,7 @@ instance
697-- > server :: Server MyApi
697-- > server :: Server MyApi
698-- > server = getBooksBy
698-- > server = getBooksBy
699−-- > where getBooksBy :: Maybe Text -> EitherT (Int, String) IO [Book]
699+-- > where getBooksBy :: Maybe Text -> EitherT ServantErr IO [Book]
700-- > getBooksBy Nothing = ...return all books...
700-- > getBooksBy Nothing = ...return all books...
701-- > getBooksBy (Just author) = ...return books by the given author...
701-- > getBooksBy (Just author) = ...return books by the given author...
702instance (KnownSymbol sym, FromText a, HasServer sublayout)
702instance (KnownSymbol sym, FromText a, HasServer sublayout)
@@ -735,7 +735,7 @@ instance (KnownSymbol sym, FromText a, HasServer sublayout)
736-- > server :: Server MyApi
736-- > server :: Server MyApi
737-- > server = getBooksBy
737-- > server = getBooksBy
738−-- > where getBooksBy :: [Text] -> EitherT (Int, String) IO [Book]
738+-- > where getBooksBy :: [Text] -> EitherT ServantErr IO [Book]
739-- > getBooksBy authors = ...return all books by these authors...
739-- > getBooksBy authors = ...return all books by these authors...
740instance (KnownSymbol sym, FromText a, HasServer sublayout)
740instance (KnownSymbol sym, FromText a, HasServer sublayout)
741 => HasServer (QueryParams sym a :> sublayout) where
741 => HasServer (QueryParams sym a :> sublayout) where
@@ -768,7 +768,7 @@ instance (KnownSymbol sym, FromText a, HasServer sublayout)
769-- > server :: Server MyApi
769-- > server :: Server MyApi
770-- > server = getBooks
770-- > server = getBooks
771−-- > where getBooks :: Bool -> EitherT (Int, String) IO [Book]
771+-- > where getBooks :: Bool -> EitherT ServantErr IO [Book]
772-- > getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
772-- > getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
773instance (KnownSymbol sym, HasServer sublayout)
773instance (KnownSymbol sym, HasServer sublayout)
774 => HasServer (QueryFlag sym :> sublayout) where
774 => HasServer (QueryFlag sym :> sublayout) where
@@ -810,7 +810,7 @@ parseMatrixText = parseQueryText
811-- > server :: Server MyApi
811-- > server :: Server MyApi
812-- > server = getBooksBy
812-- > server = getBooksBy
813−-- > where getBooksBy :: Maybe Text -> EitherT (Int, String) IO [Book]
813+-- > where getBooksBy :: Maybe Text -> EitherT ServantErr IO [Book]
814-- > getBooksBy Nothing = ...return all books...
814-- > getBooksBy Nothing = ...return all books...
815-- > getBooksBy (Just author) = ...return books by the given author...
815-- > getBooksBy (Just author) = ...return books by the given author...
816instance (KnownSymbol sym, FromText a, HasServer sublayout)
816instance (KnownSymbol sym, FromText a, HasServer sublayout)
@@ -849,7 +849,7 @@ instance (KnownSymbol sym, FromText a, HasServer sublayout)
850-- > server :: Server MyApi
850-- > server :: Server MyApi
851-- > server = getBooksBy
851-- > server = getBooksBy
852−-- > where getBooksBy :: [Text] -> EitherT (Int, String) IO [Book]
852+-- > where getBooksBy :: [Text] -> EitherT ServantErr IO [Book]
853-- > getBooksBy authors = ...return all books by these authors...
853-- > getBooksBy authors = ...return all books by these authors...
854instance (KnownSymbol sym, FromText a, HasServer sublayout)
854instance (KnownSymbol sym, FromText a, HasServer sublayout)
855 => HasServer (MatrixParams sym a :> sublayout) where
855 => HasServer (MatrixParams sym a :> sublayout) where
@@ -883,7 +883,7 @@ instance (KnownSymbol sym, FromText a, HasServer sublayout)
884-- > server :: Server MyApi
884-- > server :: Server MyApi
885-- > server = getBooks
885-- > server = getBooks
886−-- > where getBooks :: Bool -> EitherT (Int, String) IO [Book]
886+-- > where getBooks :: Bool -> EitherT ServantErr IO [Book]
887-- > getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
887-- > getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
888instance (KnownSymbol sym, HasServer sublayout)
888instance (KnownSymbol sym, HasServer sublayout)
889 => HasServer (MatrixFlag sym :> sublayout) where
889 => HasServer (MatrixFlag sym :> sublayout) where
@@ -940,7 +940,7 @@ instance HasServer Raw where
941-- > server :: Server MyApi
941-- > server :: Server MyApi
942-- > server = postBook
942-- > server = postBook
943−-- > where postBook :: Book -> EitherT (Int, String) IO Book
943+-- > where postBook :: Book -> EitherT ServantErr IO Book
944-- > postBook book = ...insert into your db...
944-- > postBook book = ...insert into your db...
945instance ( AllCTUnrender list a, HasServer sublayout
945instance ( AllCTUnrender list a, HasServer sublayout
946 ) => HasServer (ReqBody list a :> sublayout) where
946 ) => HasServer (ReqBody list a :> sublayout) where