Skip to content

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