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.
This commit is contained in:
Dimitri Fontaine 2017-05-12 13:08:30 +02:00
parent fe2e1ee956
commit 65cdc48c1e

View File

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