app: be more precise for error messages

This commit is contained in:
Patrick Boettcher 2017-01-27 10:06:16 +01:00
parent 280fea2560
commit 781fd1cebb

View File

@ -46,9 +46,9 @@ static void usage(const char *name)
static void loader(const json_uri &uri, json &schema) static void loader(const json_uri &uri, json &schema)
{ {
std::fstream lf(uri.path()); std::fstream lf("." + uri.path());
if (!lf.good()) if (!lf.good())
throw std::invalid_argument("could not open " + uri.url()); throw std::invalid_argument("could not open " + uri.url() + " tried with " + uri.path());
try { try {
lf >> schema; lf >> schema;
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
try { try {
f >> schema; f >> schema;
} catch (std::exception &e) { } catch (std::exception &e) {
std::cerr << e.what() << " at " << f.tellp() << "\n"; std::cerr << e.what() << " at " << f.tellp() << " - while parsing the schema\n";
return EXIT_FAILURE; return EXIT_FAILURE;
} }