Auth0.Android icon indicating copy to clipboard operation
Auth0.Android copied to clipboard

AuthenticationException.getDescription() has reversed if-logic

Open joknu1 opened this issue 6 months ago • 0 comments

Checklist

  • [X] The issue can be reproduced in the Auth0.Android sample app (or N/A).
  • [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • [X] I have looked into the API documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Description

In com.auth0.android.authentication.AuthenticationException there is a function:

    public fun getDescription(): String {
        if (!TextUtils.isEmpty(description)) {
            return description!!
        }
        return if (UNKNOWN_ERROR == getCode()) {
            String.format("Received error with code %s", getCode())
        } else "Failed with unknown error"
    }

where I would expect latter if to check for non-equal UNKNOWN_ERROR != getCode() instead.

Reproduction

  1. Open AuthenticationException
  2. Check logic of getDescription()

Additional context

No response

Auth0.Android version

2.11.0

Android version(s)

14

joknu1 avatar Aug 06 '24 08:08 joknu1