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

fix(pg): Pass through error if API response unexpected #1686

Merged
merged 1 commit into from
Apr 18, 2024
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
6 changes: 6 additions & 0 deletions .changeset/poor-bats-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sphinx-labs/core': patch
'@sphinx-labs/plugins': patch
---

Stop hiding API call error if response code unexpected
4 changes: 1 addition & 3 deletions packages/core/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ export const fetchDeploymentArtifacts = async (
} else if (err.response.status === 404) {
throw new Error(`No artifacts found for this project`)
} else {
throw new Error(
`Unexpected response code, please report this to the developers`
)
throw err
}
} else {
throw err
Expand Down
8 changes: 2 additions & 6 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,7 @@ export const relayProposal: RelayProposal = async (
`Internal server error. Please report this to the developers.`
)
} else {
throw new Error(
`Unexpected response code. Please report this to the developers.`
)
throw e
}
}
}
Expand Down Expand Up @@ -440,9 +438,7 @@ export const storeDeploymentConfig: StoreDeploymentConfig = async (
`Unauthorized, please check your API key and Org Id are correct`
)
} else {
throw new Error(
`Unexpected response code, please report this to the developers`
)
throw err
}
} else {
throw err
Expand Down