http2-client-grpc-effectful 1.0.0 → 1.0.1
raw patch · 3 files changed
+25/−4 lines, 3 filesdep ~http2PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: http2
API changes (from Hackage documentation)
+ Effectful.GrpcClient: instance GHC.Internal.Exception.Type.Exception Effectful.GrpcClient.GrpcError
Files
- CHANGELOG.md +6/−0
- http2-client-grpc-effectful.cabal +3/−3
- src/Effectful/GrpcClient.hs +16/−1
CHANGELOG.md view
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## [1.0.1] - 2026-08-04++### Added++- `Exception` instance for `GrpcError`.+ ## [1.0.0] - 2026-07-09 ### Added
http2-client-grpc-effectful.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: http2-client-grpc-effectful-version: 1.0.0+version: 1.0.1 synopsis: Effectful gRPC client built on http2-client-effectful description: <https://grpc.io gRPC> client for the @<https://hackage.haskell.org/package/effectful Effectful>@ ecosystem, built on top of @<https://hackage.haskell.org/package/http2-client-effectful http2-client-effectful>@.@@ -13,7 +13,7 @@ bug-reports: https://issues.digital-autonomy.institute category: Web build-type: Simple-extra-source-files:+extra-doc-files: CHANGELOG.md common common@@ -53,7 +53,7 @@ bytestring >=0.12 && <0.13, effectful >=2.6 && <2.7, http-types >=0.12 && <0.13,- http2 >=5.3 && <5.4,+ http2 >=5.3 && <5.5, http2-client-effectful >=1.0 && <1.1, http2-grpc-types >=0.5 && <0.6,
src/Effectful/GrpcClient.hs view
@@ -34,7 +34,7 @@ -- or 'GrpcError' (gRPC-level failures: bad status, malformed messages, protocol violations); -- handle both in the calling effect stack. ----- = Example Usage+-- = Example usage -- -- The examples below stub out protobuf message encoding and decoding -- with 'undefined', since they are out of scope for this module.@@ -263,6 +263,7 @@ ) where +import Control.Exception (Exception (..)) import Data.Binary.Get (Decoder (..), pushChunk, pushEndOfInput) import Data.ByteString (ByteString) import Data.ByteString qualified as ByteString@@ -388,6 +389,20 @@ | -- | A response message could not be decoded. GrpcParseError String deriving stock (Show)++instance Exception GrpcError where+ displayException GrpcTooMuchConcurrency =+ "The HTTP/2 stream was refused due to concurrency limits"+ displayException (GrpcStreamError code) =+ "The HTTP/2 stream failed with code: " <> show code+ displayException (GrpcStatusError status) =+ "Received statis from server: " <> show status+ displayException GrpcUnallowedPushPromise =+ "The server sent an HTTP/2 PUSH_PROMISE, which gRPC forbids"+ displayException (GrpcInvalidState msg) =+ "Invalid RPC state: " <> msg+ displayException (GrpcParseError msg) =+ "Could not decode RPC response: " <> msg -- | A 'PushPromiseHandler' that rejects every server push by raising a -- 'GrpcUnallowedPushPromise' error. gRPC disables HTTP\/2 push-promises.