Skip to content

Commit a65a0a3

Browse files
Code simplification.
1 parent 0690c3d commit a65a0a3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/oracledb/impl/thick/utils.pyx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,7 @@ cdef int _raise_from_info(dpiErrorInfo *error_info) except -1:
412412
Raises an exception given a dpiErrorInfo structure that is already
413413
populated with error information.
414414
"""
415-
msg_bytes = error_info.message[:error_info.messageLength]
416-
context = "%s: %s" % (error_info.fnName, error_info.action)
417-
error = errors._Error(msg_bytes.decode(), context, code=error_info.code,
418-
offset=error_info.offset,
419-
isrecoverable=bool(error_info.isRecoverable),
420-
iswarning=error_info.isWarning)
415+
error = _create_new_from_info(error_info)
421416
exc_type = get_exception_class(error_info.code)
422417
raise exc_type(error)
423418

0 commit comments

Comments
 (0)