X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fconditions.lisp;fp=base%2Fconditions.lisp;h=7fc778101abfa5bf01aa3f0feef7097f7eae9c4a;hb=43ec897ec7d84892fa59cc9b7858ce23d64a8a1a;hp=228ed36f9bacb70575f3172c2c99de39bafa40ae;hpb=5e89022823870e5f1b0a255016a8e48d6a9c53b2;p=clsql.git diff --git a/base/conditions.lisp b/base/conditions.lisp index 228ed36..7fc7781 100644 --- a/base/conditions.lisp +++ b/base/conditions.lisp @@ -157,3 +157,26 @@ and signal an clsql-invalid-spec-error if they don't match." 'clsql-nodb-error :database database)) + +;; for USQL support + +(define-condition clsql-type-error (clsql-error clsql-condition) + ((slotname :initarg :slotname + :reader clsql-type-error-slotname) + (typespec :initarg :typespec + :reader clsql-type-error-typespec) + (value :initarg :value + :reader clsql-type-error-value)) + (:report (lambda (c stream) + (format stream + "Invalid value ~A in slot ~A, not of type ~A." + (clsql-type-error-value c) + (clsql-type-error-slotname c) + (clsql-type-error-typespec c))))) + +(define-condition clsql-sql-syntax-error (clsql-error) + ((reason :initarg :reason + :reader clsql-sql-syntax-error-reason)) + (:report (lambda (c stream) + (format stream "Invalid SQL syntax: ~A" + (clsql-sql-syntax-error-reason c))))) \ No newline at end of file