Some exception classes do not handle first positional arg being a string message

Description

The CouchbaseException class accepts all optional positional arguments, but the first arg, if it exists, is expected to be a pycbc_core exception type (this is an artifact of when the bindings were first re-written and should potentially be re-worked in the future). However, there are instances when the SDK raises exceptions when only providing a message as the first positional arg. This causes issues when a user tries to access the str/repr of the exception.

The SDK should either set the message kwarg or update the _init_ of all exceptions to handle this use-case. This is correctly handled for most of the commonly raised exceptions, but should be applied in all instances.

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

Jared Casey April 28, 2023 at 3:57 AM

Exceptions updated to allow instantiation with a single positional message str argument and updated to have appropriate _str_ and _repr_ methods.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created April 14, 2023 at 2:21 AM
Updated April 28, 2023 at 3:57 AM
Resolved April 28, 2023 at 3:57 AM
Instabug