Skip to content

Throw errors from requiring messages#94

Merged
IanTheEngineer merged 1 commit intokinetic-develfrom
throwMessageErrors
Mar 28, 2018
Merged

Throw errors from requiring messages#94
IanTheEngineer merged 1 commit intokinetic-develfrom
throwMessageErrors

Conversation

@chris-smith
Copy link
Copy Markdown
Collaborator

-If an error occurs while requiring a message package, throw it.
-Add tests for expected messages, throwing error when message doesn't exist

Relates to #93, #85

Copy link
Copy Markdown
Member

@IanTheEngineer IanTheEngineer 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 for merging!

messagePackageMap[msgPackage] = ros_msg_utils.Find(msgPackage);
}
catch (err) {
throw new Error(`Unable to include message package ${msgPackage} - ${err}`);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wasn't this already re-throwing an error? Is the issue that it was swallowing the original error message?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The other function was swallowing the error but this was obscuring the actual error by changing the stack, making it harder for people to debug issues when they occur.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@IanTheEngineer IanTheEngineer merged commit f708e55 into kinetic-devel Mar 28, 2018
This was referenced Mar 28, 2018
@chris-smith chris-smith deleted the throwMessageErrors branch May 30, 2018 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants