Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing HasCallStack to getJSON, getBody #3492

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions integration/test/Testlib/HTTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ withResponse :: HasCallStack => Response -> (Response -> App a) -> App a
withResponse r k = onFailureAddResponse r (k r)

-- | Check response status code, then return body.
getBody :: Int -> Response -> App ByteString
getBody :: HasCallStack => Int -> Response -> App ByteString
getBody status resp = withResponse resp $ \r -> do
r.status `shouldMatch` status
pure r.body

-- | Check response status code, then return JSON body.
getJSON :: Int -> Response -> App Aeson.Value
getJSON :: HasCallStack => Int -> Response -> App Aeson.Value
getJSON status resp = withResponse resp $ \r -> do
r.status `shouldMatch` status
r.json

onFailureAddResponse :: Response -> App a -> App a
onFailureAddResponse :: HasCallStack => Response -> App a -> App a
onFailureAddResponse r m = App $ do
e <- ask
liftIO $ E.catch (runAppWithEnv e m) $ \(AssertionFailure stack _ msg) -> do
Expand Down