Skip to content

Commit

Permalink
fix(pg): Pass through error if API response unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Apr 18, 2024
1 parent 320bdf7 commit b54c683
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit b54c683

Please sign in to comment.