Skip to content

Commit 4d0b73c

Browse files
authored
Merge pull request #379 add external error code
2 parents a66da44 + da3583d commit 4d0b73c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ydb/issues.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class StatusCode(enum.IntEnum):
4141
UNDETERMINED = _apis.StatusIds.UNDETERMINED
4242
UNSUPPORTED = _apis.StatusIds.UNSUPPORTED
4343
SESSION_BUSY = _apis.StatusIds.SESSION_BUSY
44+
EXTERNAL_ERROR = _apis.StatusIds.EXTERNAL_ERROR
4445

4546
CONNECTION_LOST = _TRANSPORT_STATUSES_FIRST + 10
4647
CONNECTION_FAILURE = _TRANSPORT_STATUSES_FIRST + 20
@@ -170,6 +171,10 @@ class SessionBusy(Error):
170171
status = StatusCode.SESSION_BUSY
171172

172173

174+
class ExternalError(Error):
175+
status = StatusCode.EXTERNAL_ERROR
176+
177+
173178
class SessionPoolEmpty(Error, queue.Empty):
174179
status = StatusCode.SESSION_POOL_EMPTY
175180

@@ -211,6 +216,7 @@ def _format_response(response: ydb_operation_pb2.Operation) -> str:
211216
StatusCode.UNDETERMINED: Undetermined,
212217
StatusCode.UNSUPPORTED: Unsupported,
213218
StatusCode.SESSION_BUSY: SessionBusy,
219+
StatusCode.EXTERNAL_ERROR: ExternalError,
214220
}
215221

216222

0 commit comments

Comments
 (0)