diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 2d10242..9af7e92 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -75,9 +75,12 @@ nil for some reason." (interactive (list (symbol-name (symbol-at-point)))) (let* ((default-directory (project-root (project-current))) (classes (read (shell-command-to-string (concat (expand-file-name "find-php-class" oni-php-scripts-dir) " " class)))) - (class (if (> (length classes) 1) - (completing-read "Use: " classes nil t) - (car classes)))) + (class (cond + ((null classes) + (user-error "Class ā€˜%sā€™ not found" class)) + ((> (length classes) 1) + (completing-read "Use: " classes nil t)) + (t (car classes))))) (save-excursion (goto-char (point-min)) (search-forward "use ")