Skip to content

Added patch to throw exception in afterExecute and beforeExecute #41

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nottocode
Copy link
Contributor

No description provided.

logger.error("Error running pre-execution execution listener: ", t);
final String errorMessage = "Error running pre-execution execution listener: ";
logger.error(errorMessage, t);
if (listener.shouldThrowExceptionInBeforeExecute()) {

Choose a reason for hiding this comment

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

Exact same code is getting repeated at three places. Create a method like, handleExceptionInBeforeExecute() in utils and use that at all the places.
Same can be done for afterExecute as well.

final String errorMessage = "Error running post-execution execution listener: ";
logger.error(errorMessage, t);
if (listener.shouldThrowExceptionInAfterExecute()) {
throw new DataBuilderFrameworkException(DataBuilderFrameworkException.ErrorCode.BUILDER_POST_EXECUTION_ERROR,

Choose a reason for hiding this comment

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

Add test cases for both the changes

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.

3 participants