Issue Here below:
try {
----------
----------
}
catch (final SQLException e) {
LOG.error("Error Message Test: " + e.getMessage());
throw new YourException(e.getMessage(), e);
}
Solution for that:
try {
--------------
--------------
} catch (final SQLException e) {
String errorMessage = e.getMessage();
LOG.error("Error Message Test: " + errorMessage);
throw new YourException(errorMessage, e);
try {
----------
----------
}
catch (final SQLException e) {
LOG.error("Error Message Test: " + e.getMessage());
throw new YourException(e.getMessage(), e);
}
Solution for that:
try {
--------------
--------------
} catch (final SQLException e) {
String errorMessage = e.getMessage();
LOG.error("Error Message Test: " + errorMessage);
throw new YourException(errorMessage, e);
Thank you, good solution.
ReplyDeleteIf e is an object and we don't know whether the embedded object inside e is null or not.
ReplyDeleteIn this scenario who to cover it so that we don't get the above error ??
thanks man
ReplyDelete