storyblok-cli icon indicating copy to clipboard operation
storyblok-cli copied to clipboard

feat: CLI error message now gives more info about the error

Open gbyesiltas opened this issue 8 months ago • 1 comments

PR type

  • [ ] Bugfix
  • [X] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Other (please describe):

How to test this PR

  1. Trigger a cli command that will trigger an error
  2. You should see the error message instead of Error [object Object]

What is the new behavior?

  • e.message now takes precedence over the whole of the error object
  • The error object is now stringified instead of showing Error [object Object]

Other information

I recently ran the pull-components command and received this error message and I thought we could improve the Error: [object Object] part:

- Executing pull-components task
X An error ocurred in pull-components task when load components data
X An error occurred when executing the pull-components task: Error: [object Object]

I don't have a very broad understanding of the repo so please feel free to ask for a modification or do the necessary modifications if needed :)

gbyesiltas avatar May 30 '24 15:05 gbyesiltas