Skip to content

Commit 60be5f3

Browse files
authored
Raise ConfigurationError on invalid auth argument (#1162)
Instead of `AuthError`. This improves the differentiation between `DriverError` for client-side errors and `Neo4jError` for server-side errors.
1 parent c0b60cc commit 60be5f3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
2222
- Remove deprecated exports from `neo4j`:
2323
- `log`, `Config`, `PoolConfig`, `SessionConfig`, `WorkspaceConfig` (internal - no replacement)
2424
- `SummaryNotificationPosition` (use `SummaryInputPosition` instead)
25+
- Changed errors raised under certain circumstances
26+
- `ConfigurationError` if the passed `auth` parameters is not valid (instead of `AuthError`)
27+
- This improves the differentiation between `DriverError` for client-side errors and `Neo4jError` for server-side errors.
2528

2629

2730
## Version 5.28

src/neo4j/_auth_management.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from dataclasses import dataclass
2323

2424
from .api import Auth
25-
from .exceptions import AuthError
25+
from .exceptions import ConfigurationError
2626

2727

2828
if t.TYPE_CHECKING:
@@ -321,7 +321,6 @@ def to_auth_dict(auth: _TAuth) -> dict[str, t.Any]:
321321
try:
322322
return vars(auth)
323323
except (KeyError, TypeError) as e:
324-
# TODO: 6.0 - change this to be a DriverError (or subclass)
325-
raise AuthError(
324+
raise ConfigurationError(
326325
f"Cannot determine auth details from {auth!r}"
327326
) from e

0 commit comments

Comments
 (0)