Ignore:
Timestamp:
01/17/2008 11:35:17 PM (18 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
error-handling
revision id:
dsowen@fugue88.ws-20080117233517-vus49ythg3fulf0z
Message:

Added some more errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • error-handling/src/odbc/odbc-functions.lisp

    r3 r4  
    120120  (:report print-odbc-error))
    121121
     122(define-condition odbc-not-null-violation (odbc-error) ())
     123
    122124(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) ())
    123133
    124134(defun read-and-throw-error (henv hdbc hstmt)
     
    127137                    (or hdbc (cffi:null-pointer))
    128138                    (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))
    130145                            :test #'string=))))
    131146      (error (if type type 'odbc-error)
Note: See TracChangeset for help on using the changeset viewer.