*all-project*))
(defun failures (project-name)
- (length
- (remove-if-not
- (lambda (branch) (eql :failed (job-status (branch-job branch))))
- (if project-name
- (find-branch-by-project
- (find project-name *all-project* :test #'string= :key #'project-name))
- *all-branch*))))
+ (let
+ ((project (when project-name (find project-name *all-project* :test #'string= :key #'project-name))))
+ (when (and project-name (not project)) (raise-candle-error :project-does-not-exist))
+ (length
+ (remove-if-not
+ (lambda (branch) (eql :failed (job-status (branch-job branch))))
+ (if project (find-branch-by-project project) *all-branch*)))))