Skip to content

Commit 83f1fa1

Browse files
authored
Make UnsupportedServerProduct subclass of ConfigurationError (#1224)
1 parent b6adfbd commit 83f1fa1

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
4141
- Consistently check the value (also for non-routing drivers)
4242
- `neo4j.exceptions.UnsupportedServerProduct` if no common bolt protocol version could be negotiated with the server
4343
(instead of internal `neo4j._exceptions.BoltHandshakeError`).
44-
`UnsupportedServerProduct` is now a subclass of `ServiceUnavailable` (instead of `Exception` directly).
44+
`UnsupportedServerProduct` is now a subclass of `ConfigurationError` (instead of `Exception` directly).
4545
- `connection_acquisition_timeout` configuration option
4646
- Raise `ValueError` on invalid values (instead of `ClientError`).
4747
- Consistently restrict the value to be strictly positive
@@ -71,7 +71,7 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
7171
If you were calling it directly, please use `Record.__getitem__(slice(...))` or simply `record[...]` instead.
7272
- Bookmarks
7373
- Remove deprecated class `neo4j.Bookmark` in favor of `neo4j.Bookmarks`.
74-
- Remove deprecated class `session.last_bookmark()` in favor of `last_bookmarks()`.
74+
- Remove deprecated method `session.last_bookmark()` in favor of `last_bookmarks()`.
7575
- Deprecate passing raw sting bookmarks as `initial_bookmarks` to `GraphDatabase.bookmark_manager()`.
7676
Use a `neo4j.Bookmarks` object instead.
7777
- `Driver.session()` no longer accepts raw string bookmarks as `bookmarks` argument.

docs/source/api.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,8 +2084,6 @@ Client-side errors
20842084

20852085
* :class:`neo4j.exceptions.ReadServiceUnavailable`
20862086

2087-
* :class:`neo4j.exceptions.UnsupportedServerProduct`
2088-
20892087
* :class:`neo4j.exceptions.IncompleteCommit`
20902088

20912089
* :class:`neo4j.exceptions.ConfigurationError`
@@ -2094,6 +2092,8 @@ Client-side errors
20942092

20952093
* :class:`neo4j.exceptions.CertificateConfigurationError`
20962094

2095+
* :class:`neo4j.exceptions.UnsupportedServerProduct`
2096+
20972097
* :class:`neo4j.exceptions.ConnectionPoolError`
20982098

20992099
* :class:`neo4j.exceptions.ConnectionAcquisitionTimeoutError`
@@ -2145,9 +2145,6 @@ Client-side errors
21452145
.. autoexception:: neo4j.exceptions.ReadServiceUnavailable()
21462146
:show-inheritance:
21472147

2148-
.. autoexception:: neo4j.exceptions.UnsupportedServerProduct()
2149-
:show-inheritance:
2150-
21512148
.. autoexception:: neo4j.exceptions.IncompleteCommit()
21522149
:show-inheritance:
21532150

@@ -2160,6 +2157,9 @@ Client-side errors
21602157
.. autoexception:: neo4j.exceptions.CertificateConfigurationError()
21612158
:show-inheritance:
21622159

2160+
.. autoexception:: neo4j.exceptions.UnsupportedServerProduct()
2161+
:show-inheritance:
2162+
21632163

21642164

21652165
Internal Driver Errors

src/neo4j/exceptions.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
+ RoutingServiceUnavailable
5252
+ WriteServiceUnavailable
5353
+ ReadServiceUnavailable
54-
+ UnsupportedServerProduct
5554
+ IncompleteCommit
5655
+ ConfigurationError
5756
+ AuthConfigurationError
5857
+ CertificateConfigurationError
58+
+ UnsupportedServerProduct
5959
+ ConnectionPoolError
6060
+ ConnectionAcquisitionTimeoutError
6161
"""
@@ -1028,20 +1028,6 @@ class ReadServiceUnavailable(ServiceUnavailable):
10281028
"""Raised when no read service is available."""
10291029

10301030

1031-
# DriverError > ServiceUnavailable > UnsupportedServerProduct
1032-
class UnsupportedServerProduct(ServiceUnavailable):
1033-
"""
1034-
Raised when an unsupported server product is detected.
1035-
1036-
.. versionchanged:: 6.0
1037-
This exception is now a subclass of :class:`ServiceUnavailable`.
1038-
Before it was a subclass of :class:`Exception`.
1039-
"""
1040-
1041-
def __init__(self, *args: object) -> None:
1042-
super().__init__(*args)
1043-
1044-
10451031
# DriverError > ServiceUnavailable > IncompleteCommit
10461032
class IncompleteCommit(ServiceUnavailable):
10471033
"""
@@ -1085,6 +1071,20 @@ class CertificateConfigurationError(ConfigurationError):
10851071
"""Raised when there is an error with the certificate configuration."""
10861072

10871073

1074+
# DriverError > ConfigurationError > UnsupportedServerProduct
1075+
class UnsupportedServerProduct(ConfigurationError):
1076+
"""
1077+
Raised when an unsupported server product is detected.
1078+
1079+
.. versionchanged:: 6.0
1080+
This exception is now a subclass of :class:`ConfigurationError`.
1081+
Before it was a subclass of :class:`Exception`.
1082+
"""
1083+
1084+
def __init__(self, *args: object) -> None:
1085+
super().__init__(*args)
1086+
1087+
10881088
# DriverError > ConnectionPoolError
10891089
class ConnectionPoolError(DriverError):
10901090
"""Raised when the connection pool encounters an error."""

0 commit comments

Comments
 (0)