Skip to content

Show readable messages on apps login error #3

Description

@gbasolu

Problem

When an app do a login, if there is an error (username/password missing or incorrect) the login method raise an exception.
This is correct when there is the need to manage it at an higher level, but it is bad when the app is executed from the command line, because it is hard to understand that the problem was just a wrong login instead of something worse.

Solution

every app will have an additional switch "suppress_exception" so that in case of errors they will be showed with a friendly message (eg. "The username is mandatory" or "login info wrong") and the exception will not be shown.

Code suggestion to add in the app:

if self.suppress_exception:
    log.error("Unable to log in")
else:
    Raise("Unable to log in")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions