Skip to content

Commit 6a4faed

Browse files
ensure error exists before extracting err details
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 4fe5919 commit 6a4faed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/databricks/sql/backend/sea/backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,10 @@ def _check_command_not_in_failed_or_closed_state(
410410
)
411411
if state == CommandState.FAILED:
412412
error = status.error
413+
error_code = error.error_code if error else "UNKNOWN_ERROR_CODE"
414+
error_message = error.message if error else "UNKNOWN_ERROR_MESSAGE"
413415
raise ServerOperationError(
414-
"Command failed: {} {}".format(error.error_code, error.message),
416+
"Command failed: {} {}".format(error_code, error_message),
415417
{
416418
"operation-id": command_id,
417419
},

0 commit comments

Comments
 (0)