TAMULib / weaver-components

Custom Web Components for the Weaver UI
MIT License
0 stars 1 forks source link

Fix bad error handling and reporting wvr-button. #504

Closed kaladay closed 2 years ago

kaladay commented 2 years ago

There is no reason to initialize valid and then immediately overwrite it. The variable is also unnecessary.

The initial check that prints the warning "something went wrong parsing the action input." prevents all other checks from happening. These other checks provide more detailed error reporting. Simplify this check and change the error message to only report a warning when no registered actions were found.

Remove useless and redundant checks. Add additional checks for when parts are empty. Many of the more detailed checks are pointless.

One of the entire if blocks appears bogus. The parts[0] is used to get the registered actions. This should not be a part of its own actions.

Fix grammar in error messages.

With this change, more useful error messages appear. Examples:

No registered actions were found for 'Store.Action'.

Rather than this:

something went wrong parsing the action input.