Skip to content

Roc logging doesn't work in verbose mode if error.stack is falsy #197

Description

@Alxandr

I had a library give me errors that had error.stack set to false, which roc just logs as false (instead of the error message). See:

image

This is not very helpful as the error message is lost, and I have to step through roc code to figure out what went wrong.

The offending piece of code can be found here and here. I suggest adding a check (in addition to whether or not verbose logging is enabled) to see if error.stack is truthy. Something like this:

return `\n\n${getContext().verbose && error.stack ? error.stack : error.toString().replace(/^Error: /, '')}`;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions