From a35a4f97dd7e5f6f029b5e0f855bfd73ef338ca4 Mon Sep 17 00:00:00 2001 From: sth Date: Wed, 2 May 2018 16:03:20 +0200 Subject: [PATCH] Show error message to user when publishing fails (#5771) --- src/cli/commands/publish.js | 2 +- src/reporters/lang/en.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/publish.js b/src/cli/commands/publish.js index 0cf87b3564..1435ea7edb 100644 --- a/src/cli/commands/publish.js +++ b/src/cli/commands/publish.js @@ -114,7 +114,7 @@ async function publish(config: Config, pkg: any, flags: Object, dir: string): Pr body: root, }); } catch (error) { - throw new MessageError(config.reporter.lang('publishFail')); + throw new MessageError(config.reporter.lang('publishFail', error.message)); } await config.executeLifecycleScript('publish'); diff --git a/src/reporters/lang/en.js b/src/reporters/lang/en.js index f6f585f07e..d402e27a7c 100644 --- a/src/reporters/lang/en.js +++ b/src/reporters/lang/en.js @@ -321,7 +321,7 @@ const messages = { incorrectCredentials: 'Incorrect username or password.', clearedCredentials: 'Cleared login credentials.', - publishFail: "Couldn't publish package.", + publishFail: "Couldn't publish package: $0", publishPrivate: 'Package marked as private, not publishing.', published: 'Published.', publishing: 'Publishing',