0.8.12.4:
[sbcl.git] / src / pcl / methods.lisp
index 8cd94fa..c15b6c8 100644 (file)
     (add-method generic-function new)
     new))
 
+(define-condition find-method-length-mismatch
+    (reference-condition simple-error)
+  ()
+  (:default-initargs :references '(:ansi-cl :function find-method)))
+
 (defun real-get-method (generic-function qualifiers specializers
                        &optional (errorp t) 
                        always-check-specializers)
        ;; instead we need to to this here or users may get hit by a
        ;; failed AVER instead of a sensible error message.
        (when (/= lspec nreq)
-         (error "~@<The generic function ~S takes ~D required argument~:P; ~
-                 was asked to find a method with specializers ~S~@:>"
-                generic-function nreq specializers))))
+         (error 
+          'find-method-length-mismatch
+          :format-control
+          "~@<The generic function ~S takes ~D required argument~:P; ~
+            was asked to find a method with specializers ~S~@:>"
+          :format-arguments (list generic-function nreq specializers)))))
     (let ((hit 
           (dolist (method methods)
             (let ((mspecializers (method-specializers method)))