FIRE-17774: Expose Boost exceptions to preproc output

master
Kadah_Coba 2016-02-05 21:40:55 -08:00
parent 1da2e80541
commit 8520d4676a
1 changed files with 15 additions and 3 deletions

View File

@ -1391,7 +1391,19 @@ void FSLSLPreprocessor::start_process()
errored = true;
// some preprocessing error
LLStringUtil::format_map_t args;
args["[NAME]"] = name;
args["[ERR_NAME]"] = e.file_name();
args["[LINENUMBER]"] = llformat("%d",e.line_no()-1);
args["[ERR_DESC]"] = e.description();
std::string err = LLTrans::getString("fs_preprocessor_wave_exception", args);
LL_WARNS("FSLSLPreprocessor") << err << LL_ENDL;
display_error(err);
}
catch(boost::wave::cpplexer::lexing_exception const& e)
{
errored = true;
// lexing preprocessing error
LLStringUtil::format_map_t args;
args["[ERR_NAME]"] = e.file_name();
args["[LINENUMBER]"] = llformat("%d",e.line_no()-1);
args["[ERR_DESC]"] = e.description();
std::string err = LLTrans::getString("fs_preprocessor_wave_exception", args);
@ -1403,7 +1415,7 @@ void FSLSLPreprocessor::start_process()
FAILDEBUG
errored = true;
LLStringUtil::format_map_t args;
args["[NAME]"] = std::string(current_position.get_file().c_str());
args["[ERR_NAME]"] = std::string(current_position.get_file().c_str());
args["[LINENUMBER]"] = llformat("%d", current_position.get_line());
args["[ERR_DESC]"] = e.what();
display_error(LLTrans::getString("fs_preprocessor_exception", args));
@ -1413,7 +1425,7 @@ void FSLSLPreprocessor::start_process()
FAILDEBUG
errored = true;
LLStringUtil::format_map_t args;
args["[NAME]"] = std::string(current_position.get_file().c_str());
args["[ERR_NAME]"] = std::string(current_position.get_file().c_str());
args["[LINENUMBER]"] = llformat("%d", current_position.get_line());
std::string err = LLTrans::getString("fs_preprocessor_error", args);
LL_WARNS("FSLSLPreprocessor") << err << LL_ENDL;