Skip to content

Commit 814cecc

Browse files
committed
fix: If a publish results in a 500 error guide user on where to get support.
1 parent 16b9bae commit 814cecc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/strong-insects-try.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"jsrepo": patch
3+
---
4+
5+
fix: If a publish results in a `500` error guide user on where to get support.
6+

src/commands/publish.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ async function _publish(options: Options) {
433433
if (!response.ok) {
434434
const res = (await response.json()) as { message: string };
435435

436+
if (response.status === 500) {
437+
program.error(
438+
`${color.red(`${color.bold('[jsrepo.com]')} ${color.bold(response.status)} ${res.message}`)}\nPlease try again. If this persists please contact support at ${color.cyan('https://www.jsrepo.com/help')}`
439+
);
440+
}
441+
436442
program.error(
437443
color.red(`${color.bold('[jsrepo.com]')} ${color.bold(response.status)} ${res.message}`)
438444
);

0 commit comments

Comments
 (0)