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

Use TruffleError instead of Error while parsing mutually exclusive options #5433

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

sukanyaparashar
Copy link
Contributor

@sukanyaparashar sukanyaparashar commented Aug 12, 2022

ISSUE

Truffle uses the generic Error type in some situations that provide a stack trace to the users that is unnecessary.
For example: Using mutually exclusive options, --url and --network with truffle console and truffle debug includes a stack trace, which is irrelevant to the users, as Truffle doesn't allow these two options to be specified together. See #5296.

SOLUTION

This PR resolves this issue by using TruffleError instead of the generic Error type while parsing the mutually exclusive options, --url and --network with truffle console and truffle debug.

@sukanyaparashar sukanyaparashar changed the title Use TruffleError instead of Error in parsing options Use TruffleError instead of Error in parsing mutually exclusive options Aug 15, 2022
@sukanyaparashar sukanyaparashar changed the title Use TruffleError instead of Error in parsing mutually exclusive options Use TruffleError instead of Error while parsing mutually exclusive options Aug 15, 2022
Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

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

Thanks Sukanya! Do you know, are there other instances of this in our codebase, or is this it?

@sukanyaparashar
Copy link
Contributor Author

Thanks Sukanya! Do you know, are there other instances of this in our codebase, or is this it?

Hey @haltman-at, I will check the codebase once more if there happens to be other cases where we can use TruffleError instead of Error.

@haltman-at
Copy link
Contributor

Well if you checked once, I don't know if you need to check a second time! I was just making sure you remembered to check in the first place. :)

@lsqproduction
Copy link
Contributor

looks good to me. 👍

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks, @sukanyaparashar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants