diff --git a/packages/cli/changelog/@unreleased/pr-69.v2.yml b/packages/cli/changelog/@unreleased/pr-69.v2.yml new file mode 100644 index 000000000..4c56e8a07 --- /dev/null +++ b/packages/cli/changelog/@unreleased/pr-69.v2.yml @@ -0,0 +1,5 @@ +type: fix +fix: + description: Resurface `Version Already Exists` message + links: + - https://github.com/palantir/osdk-ts/pull/69 diff --git a/packages/cli/src/net/createFetch.mts b/packages/cli/src/net/createFetch.mts index 915fddc20..89a6660cd 100644 --- a/packages/cli/src/net/createFetch.mts +++ b/packages/cli/src/net/createFetch.mts @@ -63,7 +63,12 @@ function handleFetchError(e: unknown): Promise { 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(