mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #18003 -- Preserved tracebacks when re-raising errors.
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import cx_Oracle
|
||||
import sys
|
||||
from django.db.backends.oracle.introspection import DatabaseIntrospection
|
||||
from django.utils import six
|
||||
|
||||
class OracleIntrospection(DatabaseIntrospection):
|
||||
# Associating any OBJECTVAR instances with GeometryField. Of course,
|
||||
@@ -17,8 +19,11 @@ class OracleIntrospection(DatabaseIntrospection):
|
||||
(table_name.upper(), geo_col.upper()))
|
||||
row = cursor.fetchone()
|
||||
except Exception as msg:
|
||||
raise Exception('Could not find entry in USER_SDO_GEOM_METADATA corresponding to "%s"."%s"\n'
|
||||
'Error message: %s.' % (table_name, geo_col, msg))
|
||||
new_msg = (
|
||||
'Could not find entry in USER_SDO_GEOM_METADATA '
|
||||
'corresponding to "%s"."%s"\n'
|
||||
'Error message: %s.') % (table_name, geo_col, msg)
|
||||
six.reraise(Exception, Exception(new_msg), sys.exc_info()[2])
|
||||
|
||||
# TODO: Research way to find a more specific geometry field type for
|
||||
# the column's contents.
|
||||
|
||||
Reference in New Issue
Block a user