|
1 | 1 | """ |
2 | 2 | Pyneo4j exceptions raised by the client or model classes. |
3 | 3 | """ |
4 | | -from typing import List |
| 4 | +from typing import Any, List |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class Pyneo4jException(Exception): |
@@ -92,7 +92,7 @@ def __init__(self, *args: object) -> None: |
92 | 92 | super().__init__("Queries can not be run on instances which have been destroyed", *args) |
93 | 93 |
|
94 | 94 |
|
95 | | -class NoResultsFound(Pyneo4jException): |
| 95 | +class UnexpectedEmptyResult(Pyneo4jException): |
96 | 96 | """ |
97 | 97 | A query should have returned results, but did not. This exception does not include a specific |
98 | 98 | reason for why it failed, as it is not possible to determine the reason. |
@@ -149,7 +149,7 @@ def __init__(self, *args: object) -> None: |
149 | 149 |
|
150 | 150 | class NotConnectedToSourceNode(Pyneo4jException): |
151 | 151 | """ |
152 | | - The `replace()` method was called with a node which is not connected to the source node. |
| 152 | + A relationship-property method was called with a node which is not connected to the source node. |
153 | 153 | """ |
154 | 154 |
|
155 | 155 | def __init__(self, *args: object) -> None: |
@@ -200,3 +200,12 @@ def __init__( |
200 | 200 | {end_model} is being violated.""", |
201 | 201 | *args, |
202 | 202 | ) |
| 203 | + |
| 204 | + |
| 205 | +class NoResultFound(Pyneo4jException): |
| 206 | + """ |
| 207 | + A query with required filters did not match any results. |
| 208 | + """ |
| 209 | + |
| 210 | + def __init__(self, filters: Any, *args: object) -> None: |
| 211 | + super().__init__(f"No matching results for filter {filters}", *args) |
0 commit comments