@@ -137,7 +137,7 @@ void LuaSandbox::Initialize()
137
137
existingLogger->warn (" CET launched with MO2." );
138
138
}
139
139
}
140
-
140
+
141
141
// copy whitelisted things from global table
142
142
for (const auto * cKey : s_cVMGlobalObjectsWhitelist)
143
143
{
@@ -448,6 +448,9 @@ void LuaSandbox::InitializeIOForSandbox(Sandbox& aSandbox, const sol::state& acp
448
448
{
449
449
current_path (previousCurrentPath);
450
450
451
+ auto logger = cSBEnv[" __logger" ].get <std::shared_ptr<spdlog::logger>>();
452
+ logger->error (" Error: Cannot load module '{}': {}" , acPath, std::get<1 >(res).as <std::string>());
453
+
451
454
return res;
452
455
}
453
456
@@ -464,6 +467,9 @@ void LuaSandbox::InitializeIOForSandbox(Sandbox& aSandbox, const sol::state& acp
464
467
{
465
468
current_path (previousCurrentPath);
466
469
470
+ auto logger = cSBEnv[" __logger" ].get <std::shared_ptr<spdlog::logger>>();
471
+ logger->error (" Error: Cannot load module '{}': {}" , acPath, e.what ());
472
+
467
473
return std::make_tuple (sol::nil, make_object (stateView, e.what ()));
468
474
}
469
475
@@ -477,12 +483,12 @@ void LuaSandbox::InitializeIOForSandbox(Sandbox& aSandbox, const sol::state& acp
477
483
return std::make_tuple (resultObj, sol::nil);
478
484
}
479
485
486
+ current_path (previousCurrentPath);
487
+
480
488
sol::error err = result;
481
489
auto logger = cSBEnv[" __logger" ].get <std::shared_ptr<spdlog::logger>>();
482
490
logger->error (" Error: Cannot load module '{}': {}" , acPath, err.what ());
483
491
484
- current_path (previousCurrentPath);
485
-
486
492
return std::make_tuple (sol::nil, make_object (stateView, err.what ()));
487
493
}
488
494
0 commit comments