Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework exception handling #217

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

neomilium
Copy link
Contributor

This commit gives the user a better output message:

  • it uses the exception message if available or fallback on the "Error during update" message
  • it prefixes the message by the current module name

This commits introduces a ModuleSync::Error that will be used to raise
exceptions, with a message outputed on stderr, but without a full
backtrace, useless for user.

It keeps the current behavior when error (ie. StandardError) comes from
templates (ie. ERB) rendering as user may need to see why the rendering
failed.

Git::GitExecuteError backtraces are now hidden too: user needs
to understand what happends, with the error message, but not where error
occured.

lib/modulesync.rb Outdated Show resolved Hide resolved
lib/modulesync/repository.rb Show resolved Hide resolved
This commit gives the user a better output message:
- it uses the exception message if available or fallback on the "Error during update" message
- it prefixes the message by the current module name

This commits introduces a ModuleSync::Error that will be used to raise
exceptions, with a message outputed on stderr, but without a full
backtrace, useless for user.

It keeps the current behavior when error (ie. StandardError) comes from
templates (ie. ERB) rendering as user may need to see why the rendering
failed.

Git::GitExecuteError backtraces are now hidden too: user needs
to understand what happends, with the error message, but not where error
occured.
@neomilium neomilium force-pushed the rework-exception-handling branch from a31b0b8 to 8093878 Compare April 23, 2021 11:10
@neomilium
Copy link
Contributor Author

@ekohl Big green button?

@ekohl ekohl merged commit 44b3e75 into voxpupuli:master Apr 23, 2021
@neomilium neomilium deleted the rework-exception-handling branch April 23, 2021 12:51
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