From d132bafc07b1d903b0f24813d6cf77b9eced7a4b Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 23 Jan 2014 23:17:34 +0100 Subject: [PATCH] Refrain from parsing a non-existing command file... --- src/main.lisp | 7 ++++--- src/parser.lisp | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 6553dbd..a34c3bf 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -165,9 +165,10 @@ #'(lambda (condition) (log-message :fatal "We have a situation here.") (print-backtrace condition debug *standard-output*)))) - - (run-commands (fad:canonical-pathname filename) - :start-logger nil) + (let ((truename (probe-file filename))) + (if truename + (run-commands truename :start-logger nil) + (log-message :error "Can not find file: ~s" filename))) (format t "~&")) (condition (c) diff --git a/src/parser.lisp b/src/parser.lisp index 4b92a97..dc589f3 100644 --- a/src/parser.lisp +++ b/src/parser.lisp @@ -1862,7 +1862,9 @@ load database "The command could be using from :inline, in which case we want to parse as much as possible then use the command against an already opened stream where we moved at the beginning of the data." - (log-message :log "Parsing commands from file ~s~%" filename) + (if filename + (log-message :log "Parsing commands from file ~s~%" filename) + (error "Can not find file: ~s" maybe-relative-filename)) (process-relative-pathnames filename