From b54c68334dfd72f3bd822cc6ed68e1f3992f6113 Mon Sep 17 00:00:00 2001 From: Ryan Pate Date: Wed, 17 Apr 2024 20:29:44 -0700 Subject: [PATCH] fix(pg): Pass through error if API response unexpected --- .changeset/poor-bats-draw.md | 6 ++++++ packages/core/src/artifacts.ts | 4 +--- packages/core/src/utils.ts | 8 ++------ 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .changeset/poor-bats-draw.md diff --git a/.changeset/poor-bats-draw.md b/.changeset/poor-bats-draw.md new file mode 100644 index 000000000..7eac61881 --- /dev/null +++ b/.changeset/poor-bats-draw.md @@ -0,0 +1,6 @@ +--- +'@sphinx-labs/core': patch +'@sphinx-labs/plugins': patch +--- + +Stop hiding API call error if response code unexpected diff --git a/packages/core/src/artifacts.ts b/packages/core/src/artifacts.ts index 69c99ec62..e641f1716 100644 --- a/packages/core/src/artifacts.ts +++ b/packages/core/src/artifacts.ts @@ -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 diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index feab34ebc..72edd05fa 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -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 } } } @@ -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