From fdd76276fe85a98274bad303d46cc4c6ddcc881b Mon Sep 17 00:00:00 2001 From: Bernhard Bauer Date: Tue, 13 Feb 2024 13:22:56 +0000 Subject: [PATCH] Improve error logging when sending the result via PendingIntent fails Update the error message not to mention cancelling, as the `sendResult()` method is used for sending the completion intent as well, and also include the exception stack trace. --- .../openid/appauth/AuthorizationManagementActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/java/net/openid/appauth/AuthorizationManagementActivity.java b/library/java/net/openid/appauth/AuthorizationManagementActivity.java index 40842874..1926adaa 100644 --- a/library/java/net/openid/appauth/AuthorizationManagementActivity.java +++ b/library/java/net/openid/appauth/AuthorizationManagementActivity.java @@ -327,15 +327,15 @@ private void extractState(Bundle state) { } } - private void sendResult(PendingIntent callback, Intent cancelData, int resultCode) { + private void sendResult(PendingIntent callback, Intent intentData, int resultCode) { if (callback != null) { try { - callback.send(this, 0, cancelData); + callback.send(this, 0, intentData); } catch (CanceledException e) { - Logger.error("Failed to send cancel intent", e); + Logger.errorWithStack(e, "Failed to send intent"); } } else { - setResult(resultCode, cancelData); + setResult(resultCode, intentData); } }