Skip to content

Commit

Permalink
fix(pushnotification/android): return just the error message rather t…
Browse files Browse the repository at this point in the history
…han the whole exception (aws-amplify#9641)

Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: Caleb Pollman <cpollman@amazon.com>
  • Loading branch information
3 people authored Mar 16, 2022
1 parent 9831d3d commit 0de2768
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ public void onComplete(@NonNull Task<String> task) {
onSuccessCallback.invoke(token);
} else {
Exception exception = task.getException();
Log.e(LOG_TAG, "Error getting token: " + exception);
onErrorCallback.invoke(exception);
if (exception != null) {
String exceptionMessage = exception.getMessage();
Log.e(LOG_TAG, "Error getting token: " + exceptionMessage);
onErrorCallback.invoke(exceptionMessage);
}
}
}
});
Expand Down

0 comments on commit 0de2768

Please sign in to comment.