Skip to content

Added patch to throw exception in afterExecute and beforeExecute#41

Open
nottocode wants to merge 3 commits into
flipkart-incubator:masterfrom
nottocode:throw_exception_patch
Open

Added patch to throw exception in afterExecute and beforeExecute#41
nottocode wants to merge 3 commits into
flipkart-incubator:masterfrom
nottocode:throw_exception_patch

Conversation

@nottocode

Copy link
Copy Markdown
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()) {

Copy link
Copy Markdown

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,

Copy link
Copy Markdown

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