Changeset error-handling,4
- Timestamp:
- 01/17/2008 11:35:17 PM (18 years ago)
- branch-nick:
- error-handling
- revision id:
- dsowen@fugue88.ws-20080117233517-vus49ythg3fulf0z
- Location:
- error-handling/src/odbc
- Files:
-
- 2 edited
-
odbc-functions.lisp (modified) (2 diffs)
-
plain-odbc-package.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
error-handling/src/odbc/odbc-functions.lisp
r3 r4 120 120 (:report print-odbc-error)) 121 121 122 (define-condition odbc-not-null-violation (odbc-error) ()) 123 122 124 (define-condition odbc-foreign-key-error (odbc-error) ()) 125 126 (define-condition odbc-unique-violation (odbc-error) ()) 127 128 (define-condition odbc-check-violation (odbc-error) ()) 129 130 (define-condition odbc-insufficient-privilege (odbc-error) ()) 131 132 (define-condition odbc-undefined-object (odbc-error) ()) 123 133 124 134 (defun read-and-throw-error (henv hdbc hstmt) … … 127 137 (or hdbc (cffi:null-pointer)) 128 138 (or hstmt (cffi:null-pointer))) 129 (let ((type (cdr (assoc sql-state '(("23503" . odbc-foreign-key-error)) 139 (let ((type (cdr (assoc sql-state '(("23502" . odbc-not-null-violation) 140 ("23503" . odbc-foreign-key-error) 141 ("23505" . odbc-unique-violation) 142 ("23514" . odbc-check-violation) 143 ("42501" . odbc-insufficient-privilege) 144 ("42704" . odbc-undefined-object)) 130 145 :test #'string=)))) 131 146 (error (if type type 'odbc-error) -
error-handling/src/odbc/plain-odbc-package.lisp
r3 r4 13 13 (:export 14 14 "ODBC-ERROR" 15 "ODBC-FOREIGN-KEY-ERROR" 15 "ERROR-MESSAGE" 16 "ERROR-CODE" 17 "ODBC-NOT-NULL-VIOLATION" 18 "ODBC-FOREIGN-KEY-VIOLATION" 19 "ODBC-UNIQUE-VIOLATION" 20 "ODBC-CHECK-VIOLATION" 21 "ODBC-INSUFFICIENT-PRIVILEGE" 22 "ODBC-UNDEFINED-OBJECT" 16 23 17 24 "EXEC-QUERY"
Note: See TracChangeset
for help on using the changeset viewer.
