Skip to content

Commit

Permalink
Merge pull request #69 from palantir/zka/surface-version-already-exists
Browse files Browse the repository at this point in the history
Resurface `Version already exists` message
  • Loading branch information
zeyadkhaled authored Feb 16, 2024
2 parents 70f597a + 11ed160 commit f78d825
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/cli/changelog/@unreleased/pr-69.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Resurface `Version Already Exists` message
links:
- https://github.com/palantir/osdk-ts/pull/69
7 changes: 6 additions & 1 deletion packages/cli/src/net/createFetch.mts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ function handleFetchError(e: unknown): Promise<Response> {
tip = "Check your token has the required scopes for this operation";
}

throw new ExitProcessError(1, e.message, tip);
let message = e.message;
if (e.errorName === "Artifacts:ArtifactAlreadyExists") {
message = "Version already exists";
}

throw new ExitProcessError(1, message, tip);
}

function createRequestLoggingFetch(
Expand Down

0 comments on commit f78d825

Please sign in to comment.