Keep plugin-conf-error condition with near the plugin handling code.

This commit is contained in:
Brit Butler 2014-05-08 11:02:51 -04:00
parent b2ffed2b17
commit 57f9aeb696
3 changed files with 8 additions and 11 deletions

View file

@ -75,7 +75,6 @@ coleslaw:post and returns the tweet content.")
;; fallback to chirp for credential erros
(chirp:account/verify-credentials)
(when tweet-format
(setf *tweet-format* tweet-format)))
@ -87,7 +86,7 @@ coleslaw:post and returns the tweet content.")
:do (tweet-new-post file)))
(defun tweet-new-post (file)
"Retrieve most recent post from in memory DB and publish it."
"Retrieve content matching FILE from in memory DB and publish it."
(let ((post (coleslaw::find-content-by-path file)))
(chirp:statuses/update (%format-post 0 post))))

View file

@ -1,9 +0,0 @@
(in-package :coleslaw)
(define-condition plugin-conf-error ()
((plugin :initform "Plugin":initarg :plugin :reader plugin)
(message :initform "" :initarg :message :reader message))
(:report (lambda (condition stream)
(format stream "~A: ~A" (plugin condition) (message condition))))
(:documentation "Condition to signal when the plugin is misconfigured."))

View file

@ -19,6 +19,13 @@
(defparameter *config* nil
"A variable to store the blog configuration and plugin settings.")
(define-condition plugin-conf-error ()
((plugin :initarg :plugin :reader plugin)
(message :initarg :message :reader message))
(:report (lambda (condition stream)
(format stream "~A: ~A" (plugin condition) (message condition))))
(:documentation "Condition to signal when the plugin is misconfigured."))
(defun enable-plugin (name args)
"Given a plugin, NAME, compile+load it and call its ENABLE function with ARGS."
(flet ((plugin-path (sym)