Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Error Handling not reporting causes #75

Open
@uberfirestone

Description

Numerous catch blocks in the error handling for CLI commands do not report the root errors which can make troubleshooting very difficult.

Example 1 - In a number of places, code like this appears - in our case, on a setup command, we were having SSL issues but could not see the root error until we edited the catch to log the error.

          .catch(function () {
            cli.log.error(issuerUri + ' does not point to an Anvil Connect server')
            process.exit(1)
          })

Example 2 - While this did not cause us issues, I saw several lines like this in the code - once again, no useful output for troubleshooting.

                  } catch (e) {
                    cli.log.error('Couldn\'t write configuration file')
                    process.exit(1)
                  }

I would recommend logging err.stack||err.message||err in all these cases. If worried about it being too verbose, then you could add a command line argument to suppress (or enable) the detail...but just losing the detail makes troubleshooting much more difficult.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions