We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d0a8ae commit 142673bCopy full SHA for 142673b
domain/src/main/java/com/fernandocejas/android10/sample/domain/exception/DefaultErrorBundle.java
@@ -20,6 +20,8 @@
20
*/
21
public class DefaultErrorBundle implements ErrorBundle {
22
23
+ private static final String DEFAULT_ERROR_MSG = "Unknown error";
24
+
25
private final Exception exception;
26
27
public DefaultErrorBundle(Exception exception) {
@@ -33,10 +35,6 @@ public Exception getException() {
33
35
34
36
@Override
37
public String getErrorMessage() {
- String message = "";
- if (this.exception != null) {
38
- this.exception.getMessage();
39
- }
40
- return message;
+ return (exception != null) ? this.exception.getMessage() : DEFAULT_ERROR_MSG;
41
}
42
0 commit comments