Closed tneisinger closed 4 years ago
I think we just need an instance of HasGenRequest
for Throws err :> rest
. It's not certain where this instance should live, but you can implement it in your project for a start.
Since Throws
adds an annotation on what the endpoint might possibly return, I think the implementation can be a pass through, like:
instance (HasGenRequest rest) => HasGenRequest (Throws err :> rest) where
genRequest _ = genRequest @rest
I'm not super familiar with the library though, so i may be wrong here.
Awesome, that's what I needed! One small tweak and this seems to be working:
instance (HasGenRequest rest) => HasGenRequest (Throws err :> rest) where
genRequest _ = genRequest (Proxy :: Proxy rest)
Thanks!
A reproduction of this problem can be found here: https://github.com/tneisinger/sce-issue
I'm trying to use
servant-quickcheck
andservant-checked-exceptions
together on a project, but I'm getting the following error:With an
API
defined like this:And a test defined like this:
I wasn't sure if I should submit this issue here or on the
servant-checked-exceptions
repo, but I decided here might be the better place. Hopefully it isn't inappropriate to ask this here.Has anyone else dealt with this issue before? Any advice?
I think the advanced type-magic involved here puts this problem a bit out of my depth, so any help is greatly appreciated. Thanks!