Skip to content

Commit 1aee233

Browse files
committed
Exceptions: Exceptions from the BLOB API now include their full names
Before: myfiles/041f06fd774092478d450774f5ba30c5da78acc8 After: DigestNotFoundException('myfiles/041f06fd774092478d450774f5ba30c5da78acc8') This applies to both `DigestNotFoundException` and `BlobLocationNotFoundException`.
1 parent d29fc31 commit 1aee233

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Unreleased
1111
* Make `uv` the recommended tool for local development.
1212
* Simplify versioning when creating a new release.
1313
* Increase the number of tests and overall coverage.
14+
- Exceptions: Exceptions from the BLOB API now include their full names.
1415

1516
2025/01/30 2.0.0
1617
================

docs/by-example/http.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Trying to get a non-existing blob throws an exception:
118118
>>> http_client.blob_get('myfiles', '041f06fd774092478d450774f5ba30c5da78acc8')
119119
Traceback (most recent call last):
120120
...
121-
crate.client.exceptions.DigestNotFoundException: myfiles/041f06fd774092478d450774f5ba30c5da78acc8
121+
crate.client.exceptions.DigestNotFoundException: DigestNotFoundException('myfiles/041f06fd774092478d450774f5ba30c5da78acc8')
122122

123123
Creating a new blob - this method returns ``True`` if the blob was newly created:
124124

@@ -173,7 +173,7 @@ Uploading a blob to a table with disabled blob support throws an exception:
173173
... 'locations', '040f06fd774092478d450774f5ba30c5da78acc8', f)
174174
Traceback (most recent call last):
175175
...
176-
crate.client.exceptions.BlobLocationNotFoundException: locations/040f06fd774092478d450774f5ba30c5da78acc8
176+
crate.client.exceptions.BlobLocationNotFoundException: BlobLocationNotFoundException('locations/040f06fd774092478d450774f5ba30c5da78acc8')
177177

178178
>>> http_client.close()
179179
>>> f.close()

src/crate/client/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(self, table, digest):
8686
self.digest = digest
8787

8888
def __str__(self):
89-
return f"{self.__class__.__qualname__}('{self.table}/{self.digest})'"
89+
return f"{self.__class__.__qualname__}('{self.table}/{self.digest}')"
9090

9191

9292
class DigestNotFoundException(BlobException):

tests/client/test_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ def test_error_with_error_trace():
1414

1515
def test_blob_exception():
1616
err = BlobException(table="sometable", digest="somedigest")
17-
assert str(err) == "BlobException('sometable/somedigest)'"
17+
assert str(err) == "BlobException('sometable/somedigest')"

0 commit comments

Comments
 (0)