Refrain from parsing a non-existing command file...

This commit is contained in:
Dimitri Fontaine 2014-01-23 23:17:34 +01:00
parent 3f61c66a79
commit d132bafc07
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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