Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error.message || error on failed command #7388

Merged
merged 2 commits into from Aug 12, 2020

Conversation

jasonprado
Copy link
Contributor

Some exceptions, like module inclusion errors, don't generate nice
Error objects with message defined. This causes hard-to-debug failures.
When encountering an error with no message, show the whole Error object.

Description of what you did:

In the strapi executable if a subcommand throws an error the driver prints error.message. But some errors don't have a message and this leads to a bad error message in the console. I print error.message || error instead.

Some exceptions, like module inclusion errors, don't generate nice
Error objects with message defined. This causes hard-to-debug failures.
When encountering an error with no message, show the whole Error object.

Signed-off-by: Jason Prado <jason.prado@gmail.com>
@codecov
Copy link

codecov bot commented Aug 9, 2020

Codecov Report

Merging #7388 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7388   +/-   ##
=======================================
  Coverage   26.22%   26.22%           
=======================================
  Files        1131     1131           
  Lines       15433    15433           
  Branches     2443     2443           
=======================================
  Hits         4048     4048           
  Misses       9565     9565           
  Partials     1820     1820           
Flag Coverage Δ
#front 18.26% <ø> (ø)
#unit 53.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e25a508...c455918. Read the comment docs.

@alexandrebodin alexandrebodin added source: cli Source is cli package issue: enhancement Issue suggesting an enhancement to an existing feature labels Aug 10, 2020
@alexandrebodin alexandrebodin added this to the 3.1.4 milestone Aug 10, 2020
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexandrebodin alexandrebodin merged commit 4749d61 into strapi:master Aug 12, 2020
gilfernandes pushed a commit to onepointconsulting/strapi that referenced this pull request Aug 13, 2020
Some exceptions, like module inclusion errors, don't generate nice
Error objects with message defined. This causes hard-to-debug failures.
When encountering an error with no message, show the whole Error object.

Signed-off-by: Jason Prado <jason.prado@gmail.com>

Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: cli Source is cli package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants