(defun handle-error (type code &optional (error-fun #'bdb-check-error)) (when type (if (functionp type) (funcall type) (funcall error-fun code))))