Skip to content

Commit 142673b

Browse files
committed
Correct default error message.
1 parent 0d0a8ae commit 142673b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

domain/src/main/java/com/fernandocejas/android10/sample/domain/exception/DefaultErrorBundle.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
public class DefaultErrorBundle implements ErrorBundle {
2222

23+
private static final String DEFAULT_ERROR_MSG = "Unknown error";
24+
2325
private final Exception exception;
2426

2527
public DefaultErrorBundle(Exception exception) {
@@ -33,10 +35,6 @@ public Exception getException() {
3335

3436
@Override
3537
public String getErrorMessage() {
36-
String message = "";
37-
if (this.exception != null) {
38-
this.exception.getMessage();
39-
}
40-
return message;
38+
return (exception != null) ? this.exception.getMessage() : DEFAULT_ERROR_MSG;
4139
}
4240
}

0 commit comments

Comments
 (0)