servant-checked-exceptions-core 2.2.0.0 → 2.2.0.1
raw patch · 4 files changed
+39/−17 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Servant.Checked.Exceptions.Internal.Servant.Docs: instance forall k1 k2 (ctypes :: k2). Servant.Checked.Exceptions.Internal.Servant.Docs.CreateRespBodiesFor '[] ctypes
+ Servant.Checked.Exceptions.Internal.Servant.Docs: instance forall k1 k2 (ctypes :: k1). Servant.Checked.Exceptions.Internal.Servant.Docs.CreateRespBodiesFor '[] ctypes
- Servant.Checked.Exceptions: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
+ Servant.Checked.Exceptions: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
- Servant.Checked.Exceptions: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
+ Servant.Checked.Exceptions: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
- Servant.Checked.Exceptions: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
+ Servant.Checked.Exceptions: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
- Servant.Checked.Exceptions: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
+ Servant.Checked.Exceptions: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
- Servant.Checked.Exceptions: type DeleteWithErr = VerbWithErr 'DELETE 200
+ Servant.Checked.Exceptions: type DeleteWithErr = VerbWithErr 'DELETE 200
- Servant.Checked.Exceptions: type GetAcceptedWithErr = VerbWithErr 'GET 202
+ Servant.Checked.Exceptions: type GetAcceptedWithErr = VerbWithErr 'GET 202
- Servant.Checked.Exceptions: type GetNoContentWithErr = VerbWithErr 'GET 204
+ Servant.Checked.Exceptions: type GetNoContentWithErr = VerbWithErr 'GET 204
- Servant.Checked.Exceptions: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
+ Servant.Checked.Exceptions: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
- Servant.Checked.Exceptions: type GetPartialContentWithErr = VerbWithErr 'GET 206
+ Servant.Checked.Exceptions: type GetPartialContentWithErr = VerbWithErr 'GET 206
- Servant.Checked.Exceptions: type GetResetContentWithErr = VerbWithErr 'GET 205
+ Servant.Checked.Exceptions: type GetResetContentWithErr = VerbWithErr 'GET 205
- Servant.Checked.Exceptions: type GetWithErr = VerbWithErr 'GET 200
+ Servant.Checked.Exceptions: type GetWithErr = VerbWithErr 'GET 200
- Servant.Checked.Exceptions: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
+ Servant.Checked.Exceptions: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
- Servant.Checked.Exceptions: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
+ Servant.Checked.Exceptions: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
- Servant.Checked.Exceptions: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
+ Servant.Checked.Exceptions: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
- Servant.Checked.Exceptions: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
+ Servant.Checked.Exceptions: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
- Servant.Checked.Exceptions: type PatchWithErr = VerbWithErr 'PATCH 200
+ Servant.Checked.Exceptions: type PatchWithErr = VerbWithErr 'PATCH 200
- Servant.Checked.Exceptions: type PostAcceptedWithErr = VerbWithErr 'POST 202
+ Servant.Checked.Exceptions: type PostAcceptedWithErr = VerbWithErr 'POST 202
- Servant.Checked.Exceptions: type PostCreatedWithErr = VerbWithErr 'POST 201
+ Servant.Checked.Exceptions: type PostCreatedWithErr = VerbWithErr 'POST 201
- Servant.Checked.Exceptions: type PostNoContentWithErr = VerbWithErr 'POST 204
+ Servant.Checked.Exceptions: type PostNoContentWithErr = VerbWithErr 'POST 204
- Servant.Checked.Exceptions: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
+ Servant.Checked.Exceptions: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
- Servant.Checked.Exceptions: type PostResetContentWithErr = VerbWithErr 'POST 205
+ Servant.Checked.Exceptions: type PostResetContentWithErr = VerbWithErr 'POST 205
- Servant.Checked.Exceptions: type PostWithErr = VerbWithErr 'POST 200
+ Servant.Checked.Exceptions: type PostWithErr = VerbWithErr 'POST 200
- Servant.Checked.Exceptions: type PutAcceptedWithErr = VerbWithErr 'PUT 202
+ Servant.Checked.Exceptions: type PutAcceptedWithErr = VerbWithErr 'PUT 202
- Servant.Checked.Exceptions: type PutNoContentWithErr = VerbWithErr 'PUT 204
+ Servant.Checked.Exceptions: type PutNoContentWithErr = VerbWithErr 'PUT 204
- Servant.Checked.Exceptions: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
+ Servant.Checked.Exceptions: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
- Servant.Checked.Exceptions: type PutResetContentWithErr = VerbWithErr 'PUT 205
+ Servant.Checked.Exceptions: type PutResetContentWithErr = VerbWithErr 'PUT 205
- Servant.Checked.Exceptions: type PutWithErr = VerbWithErr 'PUT 200
+ Servant.Checked.Exceptions: type PutWithErr = VerbWithErr 'PUT 200
- Servant.Checked.Exceptions.Internal.Verbs: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
+ Servant.Checked.Exceptions.Internal.Verbs: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
- Servant.Checked.Exceptions.Internal.Verbs: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
+ Servant.Checked.Exceptions.Internal.Verbs: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
- Servant.Checked.Exceptions.Internal.Verbs: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
+ Servant.Checked.Exceptions.Internal.Verbs: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
- Servant.Checked.Exceptions.Internal.Verbs: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
+ Servant.Checked.Exceptions.Internal.Verbs: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
- Servant.Checked.Exceptions.Internal.Verbs: type DeleteWithErr = VerbWithErr 'DELETE 200
+ Servant.Checked.Exceptions.Internal.Verbs: type DeleteWithErr = VerbWithErr 'DELETE 200
- Servant.Checked.Exceptions.Internal.Verbs: type GetAcceptedWithErr = VerbWithErr 'GET 202
+ Servant.Checked.Exceptions.Internal.Verbs: type GetAcceptedWithErr = VerbWithErr 'GET 202
- Servant.Checked.Exceptions.Internal.Verbs: type GetNoContentWithErr = VerbWithErr 'GET 204
+ Servant.Checked.Exceptions.Internal.Verbs: type GetNoContentWithErr = VerbWithErr 'GET 204
- Servant.Checked.Exceptions.Internal.Verbs: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
+ Servant.Checked.Exceptions.Internal.Verbs: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
- Servant.Checked.Exceptions.Internal.Verbs: type GetPartialContentWithErr = VerbWithErr 'GET 206
+ Servant.Checked.Exceptions.Internal.Verbs: type GetPartialContentWithErr = VerbWithErr 'GET 206
- Servant.Checked.Exceptions.Internal.Verbs: type GetResetContentWithErr = VerbWithErr 'GET 205
+ Servant.Checked.Exceptions.Internal.Verbs: type GetResetContentWithErr = VerbWithErr 'GET 205
- Servant.Checked.Exceptions.Internal.Verbs: type GetWithErr = VerbWithErr 'GET 200
+ Servant.Checked.Exceptions.Internal.Verbs: type GetWithErr = VerbWithErr 'GET 200
- Servant.Checked.Exceptions.Internal.Verbs: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
+ Servant.Checked.Exceptions.Internal.Verbs: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
- Servant.Checked.Exceptions.Internal.Verbs: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
+ Servant.Checked.Exceptions.Internal.Verbs: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
- Servant.Checked.Exceptions.Internal.Verbs: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
+ Servant.Checked.Exceptions.Internal.Verbs: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
- Servant.Checked.Exceptions.Internal.Verbs: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
+ Servant.Checked.Exceptions.Internal.Verbs: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
- Servant.Checked.Exceptions.Internal.Verbs: type PatchWithErr = VerbWithErr 'PATCH 200
+ Servant.Checked.Exceptions.Internal.Verbs: type PatchWithErr = VerbWithErr 'PATCH 200
- Servant.Checked.Exceptions.Internal.Verbs: type PostAcceptedWithErr = VerbWithErr 'POST 202
+ Servant.Checked.Exceptions.Internal.Verbs: type PostAcceptedWithErr = VerbWithErr 'POST 202
- Servant.Checked.Exceptions.Internal.Verbs: type PostCreatedWithErr = VerbWithErr 'POST 201
+ Servant.Checked.Exceptions.Internal.Verbs: type PostCreatedWithErr = VerbWithErr 'POST 201
- Servant.Checked.Exceptions.Internal.Verbs: type PostNoContentWithErr = VerbWithErr 'POST 204
+ Servant.Checked.Exceptions.Internal.Verbs: type PostNoContentWithErr = VerbWithErr 'POST 204
- Servant.Checked.Exceptions.Internal.Verbs: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
+ Servant.Checked.Exceptions.Internal.Verbs: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
- Servant.Checked.Exceptions.Internal.Verbs: type PostResetContentWithErr = VerbWithErr 'POST 205
+ Servant.Checked.Exceptions.Internal.Verbs: type PostResetContentWithErr = VerbWithErr 'POST 205
- Servant.Checked.Exceptions.Internal.Verbs: type PostWithErr = VerbWithErr 'POST 200
+ Servant.Checked.Exceptions.Internal.Verbs: type PostWithErr = VerbWithErr 'POST 200
- Servant.Checked.Exceptions.Internal.Verbs: type PutAcceptedWithErr = VerbWithErr 'PUT 202
+ Servant.Checked.Exceptions.Internal.Verbs: type PutAcceptedWithErr = VerbWithErr 'PUT 202
- Servant.Checked.Exceptions.Internal.Verbs: type PutNoContentWithErr = VerbWithErr 'PUT 204
+ Servant.Checked.Exceptions.Internal.Verbs: type PutNoContentWithErr = VerbWithErr 'PUT 204
- Servant.Checked.Exceptions.Internal.Verbs: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
+ Servant.Checked.Exceptions.Internal.Verbs: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
- Servant.Checked.Exceptions.Internal.Verbs: type PutResetContentWithErr = VerbWithErr 'PUT 205
+ Servant.Checked.Exceptions.Internal.Verbs: type PutResetContentWithErr = VerbWithErr 'PUT 205
- Servant.Checked.Exceptions.Internal.Verbs: type PutWithErr = VerbWithErr 'PUT 200
+ Servant.Checked.Exceptions.Internal.Verbs: type PutWithErr = VerbWithErr 'PUT 200
- Servant.Checked.Exceptions.Verbs: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
+ Servant.Checked.Exceptions.Verbs: type DeleteAcceptedWithErr = VerbWithErr 'DELETE 202
- Servant.Checked.Exceptions.Verbs: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
+ Servant.Checked.Exceptions.Verbs: type DeleteNoContentWithErr = VerbWithErr 'DELETE 204
- Servant.Checked.Exceptions.Verbs: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
+ Servant.Checked.Exceptions.Verbs: type DeleteNonAuthoritativeWithErr = VerbWithErr 'DELETE 203
- Servant.Checked.Exceptions.Verbs: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
+ Servant.Checked.Exceptions.Verbs: type DeleteResetContentWithErr = VerbWithErr 'DELETE 205
- Servant.Checked.Exceptions.Verbs: type DeleteWithErr = VerbWithErr 'DELETE 200
+ Servant.Checked.Exceptions.Verbs: type DeleteWithErr = VerbWithErr 'DELETE 200
- Servant.Checked.Exceptions.Verbs: type GetAcceptedWithErr = VerbWithErr 'GET 202
+ Servant.Checked.Exceptions.Verbs: type GetAcceptedWithErr = VerbWithErr 'GET 202
- Servant.Checked.Exceptions.Verbs: type GetNoContentWithErr = VerbWithErr 'GET 204
+ Servant.Checked.Exceptions.Verbs: type GetNoContentWithErr = VerbWithErr 'GET 204
- Servant.Checked.Exceptions.Verbs: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
+ Servant.Checked.Exceptions.Verbs: type GetNonAuthoritativeWithErr = VerbWithErr 'GET 203
- Servant.Checked.Exceptions.Verbs: type GetPartialContentWithErr = VerbWithErr 'GET 206
+ Servant.Checked.Exceptions.Verbs: type GetPartialContentWithErr = VerbWithErr 'GET 206
- Servant.Checked.Exceptions.Verbs: type GetResetContentWithErr = VerbWithErr 'GET 205
+ Servant.Checked.Exceptions.Verbs: type GetResetContentWithErr = VerbWithErr 'GET 205
- Servant.Checked.Exceptions.Verbs: type GetWithErr = VerbWithErr 'GET 200
+ Servant.Checked.Exceptions.Verbs: type GetWithErr = VerbWithErr 'GET 200
- Servant.Checked.Exceptions.Verbs: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
+ Servant.Checked.Exceptions.Verbs: type PatchAcceptedWithErr = VerbWithErr 'PATCH 202
- Servant.Checked.Exceptions.Verbs: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
+ Servant.Checked.Exceptions.Verbs: type PatchNoContentWithErr = VerbWithErr 'PATCH 204
- Servant.Checked.Exceptions.Verbs: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
+ Servant.Checked.Exceptions.Verbs: type PatchNonAuthoritativeWithErr = VerbWithErr 'PATCH 203
- Servant.Checked.Exceptions.Verbs: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
+ Servant.Checked.Exceptions.Verbs: type PatchResetContentWithErr = VerbWithErr 'PATCH 205
- Servant.Checked.Exceptions.Verbs: type PatchWithErr = VerbWithErr 'PATCH 200
+ Servant.Checked.Exceptions.Verbs: type PatchWithErr = VerbWithErr 'PATCH 200
- Servant.Checked.Exceptions.Verbs: type PostAcceptedWithErr = VerbWithErr 'POST 202
+ Servant.Checked.Exceptions.Verbs: type PostAcceptedWithErr = VerbWithErr 'POST 202
- Servant.Checked.Exceptions.Verbs: type PostCreatedWithErr = VerbWithErr 'POST 201
+ Servant.Checked.Exceptions.Verbs: type PostCreatedWithErr = VerbWithErr 'POST 201
- Servant.Checked.Exceptions.Verbs: type PostNoContentWithErr = VerbWithErr 'POST 204
+ Servant.Checked.Exceptions.Verbs: type PostNoContentWithErr = VerbWithErr 'POST 204
- Servant.Checked.Exceptions.Verbs: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
+ Servant.Checked.Exceptions.Verbs: type PostNonAuthoritativeWithErr = VerbWithErr 'POST 203
- Servant.Checked.Exceptions.Verbs: type PostResetContentWithErr = VerbWithErr 'POST 205
+ Servant.Checked.Exceptions.Verbs: type PostResetContentWithErr = VerbWithErr 'POST 205
- Servant.Checked.Exceptions.Verbs: type PostWithErr = VerbWithErr 'POST 200
+ Servant.Checked.Exceptions.Verbs: type PostWithErr = VerbWithErr 'POST 200
- Servant.Checked.Exceptions.Verbs: type PutAcceptedWithErr = VerbWithErr 'PUT 202
+ Servant.Checked.Exceptions.Verbs: type PutAcceptedWithErr = VerbWithErr 'PUT 202
- Servant.Checked.Exceptions.Verbs: type PutNoContentWithErr = VerbWithErr 'PUT 204
+ Servant.Checked.Exceptions.Verbs: type PutNoContentWithErr = VerbWithErr 'PUT 204
- Servant.Checked.Exceptions.Verbs: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
+ Servant.Checked.Exceptions.Verbs: type PutNonAuthoritativeWithErr = VerbWithErr 'PUT 203
- Servant.Checked.Exceptions.Verbs: type PutResetContentWithErr = VerbWithErr 'PUT 205
+ Servant.Checked.Exceptions.Verbs: type PutResetContentWithErr = VerbWithErr 'PUT 205
- Servant.Checked.Exceptions.Verbs: type PutWithErr = VerbWithErr 'PUT 200
+ Servant.Checked.Exceptions.Verbs: type PutWithErr = VerbWithErr 'PUT 200
Files
- CHANGELOG.md +12/−7
- README.md +15/−7
- servant-checked-exceptions-core.cabal +9/−3
- src/Servant/Checked/Exceptions/Internal/Servant/API.hs +3/−0
CHANGELOG.md view
@@ -1,16 +1,21 @@++## 2.2.0.1++* Disable doctests for GHC-9. [#39](https://github.com/cdepillabout/servant-checked-exceptions/issues/39)+ ## 2.2.0.0 -* Add the `EnvelopeT` monad transformer. [#32]+* Add the `EnvelopeT` monad transformer. [#32](https://github.com/cdepillabout/servant-checked-exceptions/pull/32) * Add a few combinators for `Envelope`: - - `envelopeRemove`- - `envelopeHandle`- - `relaxEnvelope`- - `liftA2Envelope`- - `bindEnvelope`+ - `envelopeRemove`+ - `envelopeHandle`+ - `relaxEnvelope`+ - `liftA2Envelope`+ - `bindEnvelope` - [#32]+ [#32](https://github.com/cdepillabout/servant-checked-exceptions/pull/32) ## 2.1.0.0
README.md view
@@ -2,7 +2,7 @@ Servant.Checked.Exceptions ========================== -[](http://travis-ci.org/cdepillabout/servant-checked-exceptions)+[](https://github.com/cdepillabout/servant-checked-exceptions) [](https://hackage.haskell.org/package/servant-checked-exceptions) [](http://stackage.org/lts/package/servant-checked-exceptions) [](http://stackage.org/nightly/package/servant-checked-exceptions)@@ -87,10 +87,10 @@ ## Example -This repository contains an [example](example/) of using-`servant-checked-exceptions`. This includes an [api](example/Api.hs),-[server](example/Server.hs), [client](example/Client.hs), and-[documentation](example/Docs.hs).+This repository contains an [example](servant-checked-exceptions/example/) of using+`servant-checked-exceptions`. This includes an [api](servant-checked-exceptions/example/Api.hs),+[server](servant-checked-exceptions/example/Server.hs), [client](servant-checked-exceptions/example/Client.hs), and+[documentation](servant-checked-exceptions-core/example/Docs.hs). Below I show how to compile and run these examples. @@ -99,7 +99,7 @@ The examples can be compiled by using the `buildexample` flag: ```sh-$ stack build --flag servant-checked-exceptions:buildexample+$ stack build --flag servant-checked-exceptions-core:buildexample --flag servant-checked-exceptions:buildexample ``` This creates three executables. A server, a client, and a documentaiton@@ -178,7 +178,7 @@ The documentation generator will generate documentation for the api in Markdown: ```sh-$ stack exec -- servant-checked-exceptions-example-docs+$ stack exec -- servant-checked-exceptions-core-example-docs ``` Here is a small example of the documentation that will be generated for the lax@@ -219,6 +219,14 @@ and `servant-server`. This can be useful if you are writing an API meant to be shared with ghcjs and run in a browser, where these dependencies aren't available.++## Limitations++Currently, `servant-client` only treats HTTP responses as successful if they+have a status code of 2XX. This means that any non-2XX errors thrown by+`servant-checked-exceptions` don't get parsed into a typed `Envelope` as+expected, but raised as a Servant `ClientError`. For more information, see+[issue #27](https://github.com/cdepillabout/servant-checked-exceptions/issues/27). ## Maintainers
servant-checked-exceptions-core.cabal view
@@ -1,5 +1,5 @@ name: servant-checked-exceptions-core-version: 2.2.0.0+version: 2.2.0.1 synopsis: Checked exceptions for Servant APIs. description: Please see <https://github.com/cdepillabout/servant-checked-exceptions#readme README.md>. homepage: https://github.com/cdepillabout/servant-checked-exceptions@@ -7,7 +7,7 @@ license-file: LICENSE author: Dennis Gosnell maintainer: cdep.illabout@gmail.com-copyright: 2017-2018 Dennis Gosnell+copyright: 2017-2021 Dennis Gosnell category: Web build-type: Simple extra-source-files: CHANGELOG.md@@ -81,8 +81,14 @@ build-depends: base , doctest , Glob+ , servant-checked-exceptions-core default-language: Haskell2010- ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N+ ghc-options: -Wall+ -- Doctests appear not to work with GHC-9.0.1.+ if impl(ghc < 9.0.1)+ buildable: True+ else+ buildable: False source-repository head type: git location: git@github.com:cdepillabout/servant-checked-exceptions.git
src/Servant/Checked/Exceptions/Internal/Servant/API.hs view
@@ -68,6 +68,9 @@ c :> Throwing es :> api +-- | Note that clients generated by @servant-client@ currently don't handle+-- status codes outside the @2XX@ range correctly.+-- Take a look at the README for more details. class ErrStatus e where toErrStatus :: e -> Status