From 863d3d9766a4fd940597dda1f4590fe0b973f9ed Mon Sep 17 00:00:00 2001 From: Senthil Date: Wed, 30 Mar 2016 10:46:17 -0700 Subject: [PATCH] Add clarifying message on exception --- src/corehost/cli/fxr/fx_muxer.cpp | 5 +++-- src/corehost/cli/runtime_config.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/corehost/cli/fxr/fx_muxer.cpp b/src/corehost/cli/fxr/fx_muxer.cpp index bc7effe27..3a0ed9d51 100644 --- a/src/corehost/cli/fxr/fx_muxer.cpp +++ b/src/corehost/cli/fxr/fx_muxer.cpp @@ -103,9 +103,10 @@ pal::string_t fx_muxer_t::resolve_cli_version(const pal::string_t& global_json) } retval = ver_iter->second.as_string(); } - catch (...) + catch (const web::json::json_exception& je) { - trace::error(_X("A JSON parsing exception occurred")); + pal::string_t jes = pal::to_palstring(je.what()); + trace::error(_X("A JSON parsing exception occurred: %s"), jes.c_str()); } trace::verbose(_X("CLI version is [%s] in global json file [%s]"), retval.c_str(), global_json.c_str()); return retval; diff --git a/src/corehost/cli/runtime_config.cpp b/src/corehost/cli/runtime_config.cpp index df13cc7ae..03dab4ba3 100644 --- a/src/corehost/cli/runtime_config.cpp +++ b/src/corehost/cli/runtime_config.cpp @@ -86,9 +86,10 @@ bool runtime_config_t::ensure_parsed() parse_opts(iter->second); } } - catch (...) + catch (const web::json::json_exception& je) { - trace::warning(_X("Json exception occurred.")); + pal::string_t jes = pal::to_palstring(je.what()); + trace::error(_X("A JSON parsing exception occurred: %s"), jes.c_str()); return false; } return true;