From 65cdc48c1eb5c01a7d38376fd37f334ae7cf6b2f Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 12 May 2017 13:08:30 +0200 Subject: [PATCH] Fix error conditions for unrecognized source. When the source is not recognized, pgloader would not always output a useful error message with the hint about using --type, as per #248. Here we fix the conditions applying to this error message. --- src/main.lisp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 231514d..186b3c6 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -398,19 +398,15 @@ (log-message :info "SOURCE: ~s" source) (log-message :info "TARGET: ~s" target) - (cond ((and (null source-uri) - (null target-uri) - ;; (probe-file (uiop:parse-unix-namestring source)) - ;; (probe-file (uiop:parse-unix-namestring target)) - ) + (cond ((and (null source-uri) (null target-uri)) (process-command-file (list source target))) - ((null source) + ((or (null source) (null source-uri)) (log-message :fatal "Failed to parse ~s as a source URI." source) (log-message :log "You might need to use --type.")) - ((null target) + ((or (null target) (null target-uri)) (log-message :fatal "Failed to parse ~s as a PostgreSQL database URI." target)))