]> git.lyx.org Git - features.git/commitdiff
Give an error message when LyX cannot load a file
authorScott Kostyshak <skostysh@lyx.org>
Thu, 28 Mar 2013 07:46:35 +0000 (03:46 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Sat, 30 Mar 2013 03:58:43 +0000 (23:58 -0400)
Before, the following commands correctly exited with code 1, but now
a reason for exiting is also given:

  lyx -e pdf2 doesNotExist
  lyx doesNotExist -e pdf2

src/LyX.cpp

index ec522dead9ee3a6ce79a120b7d3309750dda30b4..2096be7a771d28256a275cea6bd272551c1e5929 100644 (file)
@@ -502,6 +502,10 @@ bool LyX::loadFiles()
                }
                else {
                        pimpl_->buffer_list_.release(buf);
+                       docstring const error_message =
+                               bformat(_("LyX failed to load the following file: %1$s"),
+                               from_utf8(fname.absFileName()));
+                       lyxerr << to_utf8(error_message) << endl;
                        success = false;
                }
        }