bad-exception-cause pylint error

Bug #2054364 reported by Yanks
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstacksdk
New
Undecided
Unassigned

Bug Description

When catching `keystoneauth1.exceptions.http.Unauthorized` and re-raising from the caught exception, pylint complains about the caught exception not being an exception (which it does seem to be).

The error is: E0705: Exception cause set to something which is not an exception, nor None (bad-exception-cause)

when running pylint on the following code:

```
class CustomError(Exception):
    pass

except keystoneauth1.exceptions.http.Unauthorized as exc:
        raise CustomError( # pylint: disable=bad-exception-cause
            "Unauthorized to connect to OpenStack."
        ) from exc
```

Revision history for this message
Pierre Sassoulas (pierre-sassoulas) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.