Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

Bugfixes:
* Accept any 2xx status code (not just `200`) as success when calling the Registry API, so that publishing no longer fails when the registry responds with `201 Created`
* Fix flaky `SQLITE_IOERR_TRUNCATE` on Windows when multiple spago processes connect concurrently to the cache DB, by skipping `PRAGMA journal_mode = WAL` when it's already enabled (WAL mode is persistent in the DB file header) and tolerating the race on the initial set
* Retry transient network failures (connection errors and 5xx responses) when fetching package tarballs and calling the registry API, instead of failing immediately

Expand Down
2 changes: 1 addition & 1 deletion src/Spago/Registry.purs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ callRegistry url outputCodec maybeInput = handleError do
case response of
Nothing -> pure $ Left $ "Could not reach the registry at " <> url
Just (Left err) -> pure $ Left $ "Error while calling the registry:\n " <> Exception.message err
Just (Right { status, text }) | status /= 200 -> do
Just (Right { status, text }) | status < 200 || status >= 300 -> do
bodyText <- liftAff text
pure $ Left $ "Registry did not like this and answered with status " <> show status <> ", got answer:\n " <> bodyText
Just (Right { json }) -> do
Expand Down
Loading