@@ -210,8 +210,7 @@ Local<Value> ConfJsonClass::reload(const Arguments&) {
210210 return Boolean::newBoolean (reload ());
211211 } catch (const ordered_json::exception& e) {
212212 lse::getSelfPluginInstance ().getLogger ().error (" Fail to parse json content in file!" );
213- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
214- PrintScriptStackTrace ();
213+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
215214 return Boolean::newBoolean (false );
216215 }
217216 CATCH (" Fail in confJsonReload!" );
@@ -259,7 +258,8 @@ bool ConfJsonClass::reload() {
259258 jsonConf = ordered_json::parse (*jsonTexts, nullptr , true , true );
260259 } catch (...) {
261260 lse::getSelfPluginInstance ().getLogger ().error (" Fail in confJsonReload!" );
262- PrintScriptStackTrace ();
261+ ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ());
262+ return false ;
263263 }
264264
265265 return true ;
@@ -538,13 +538,11 @@ Local<Value> MoneyClass::set(const Arguments& args) {
538538 );
539539 } catch (const std::invalid_argument& e) {
540540 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneySet!" );
541- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
542- PrintScriptStackTrace ();
541+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
543542 return Boolean::newBoolean (false );
544543 } catch (const std::out_of_range& e) {
545544 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneySet!" );
546- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
547- PrintScriptStackTrace ();
545+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
548546 return Boolean::newBoolean (false );
549547 }
550548 CATCH (" Fail in MoneySet!" );
@@ -558,13 +556,11 @@ Local<Value> MoneyClass::get(const Arguments& args) {
558556 return Number::newNumber (EconomySystem::getMoney (args[0 ].asString ().toString ()));
559557 } catch (const std::invalid_argument& e) {
560558 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyGet!" );
561- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
562- PrintScriptStackTrace ();
559+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
563560 return Number::newNumber (0 );
564561 } catch (const std::out_of_range& e) {
565562 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyGet!" );
566- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
567- PrintScriptStackTrace ();
563+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
568564 return Number::newNumber (0 );
569565 }
570566 CATCH (" Fail in MoneyGet!" );
@@ -580,13 +576,11 @@ Local<Value> MoneyClass::add(const Arguments& args) {
580576 );
581577 } catch (const std::invalid_argument& e) {
582578 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyAdd!" );
583- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
584- PrintScriptStackTrace ();
579+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
585580 return Boolean::newBoolean (false );
586581 } catch (const std::out_of_range& e) {
587582 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyAdd!" );
588- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
589- PrintScriptStackTrace ();
583+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
590584 return Boolean::newBoolean (false );
591585 }
592586 CATCH (" Fail in MoneyAdd!" );
@@ -603,13 +597,11 @@ Local<Value> MoneyClass::reduce(const Arguments& args) {
603597 );
604598 } catch (const std::invalid_argument& e) {
605599 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyReduce!" );
606- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
607- PrintScriptStackTrace ();
600+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
608601 return Boolean::newBoolean (false );
609602 } catch (const std::out_of_range& e) {
610603 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyReduce!" );
611- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
612- PrintScriptStackTrace ();
604+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
613605 return Boolean::newBoolean (false );
614606 }
615607 CATCH (" Fail in MoneyReduce!" );
@@ -632,13 +624,11 @@ Local<Value> MoneyClass::trans(const Arguments& args) {
632624 ));
633625 } catch (const std::invalid_argument& e) {
634626 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyTrans!" );
635- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
636- PrintScriptStackTrace ();
627+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
637628 return Boolean::newBoolean (false );
638629 } catch (const std::out_of_range& e) {
639630 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyTrans!" );
640- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
641- PrintScriptStackTrace ();
631+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
642632 return Boolean::newBoolean (false );
643633 }
644634 CATCH (" Fail in MoneyTrans!" );
@@ -689,13 +679,11 @@ Local<Value> MoneyClass::getHistory(const Arguments& args) {
689679 return objectificationMoneyHistory (res);
690680 } catch (const std::invalid_argument& e) {
691681 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyGetHintory!" );
692- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
693- PrintScriptStackTrace ();
682+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
694683 return Local<Value>();
695684 } catch (const std::out_of_range& e) {
696685 lse::getSelfPluginInstance ().getLogger ().error (" Bad argument in MoneyGetHintory!" );
697- lse::getSelfPluginInstance ().getLogger ().error (ll::string_utils::tou8str (e.what ()));
698- PrintScriptStackTrace ();
686+ ll::error_utils::printException (e, lse::getSelfPluginInstance ().getLogger ());
699687 return Local<Value>();
700688 }
701689 CATCH (" Fail in MoneyGetHintory!" );
0 commit comments