Skip to content

Commit 1eeaf7f

Browse files
committed
fix: fix output of plugin load error
1 parent 242d454 commit 1eeaf7f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lse/PluginManager.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@ ll::Expected<> PluginManager::load(ll::mod::Manifest manifest) {
216216
return plugin->onLoad().transform([&, this] { addMod(manifest.name, plugin); });
217217
} catch (const Exception& e) {
218218
if (scriptEngine) {
219-
EngineScope engineScope(scriptEngine);
220-
auto error = ll::makeStringError(
221-
"Failed to load plugin {0}: {1}\n{2}"_tr(manifest.name, e.message(), e.stacktrace())
222-
);
223-
ExitEngineScope exit;
219+
auto error = [&] {
220+
EngineScope engineScope(scriptEngine);
221+
return ll::makeStringError(
222+
"Failed to load plugin {0}: {1}\n{2}"_tr(manifest.name, e.message(), e.stacktrace())
223+
);
224+
}();
224225

225226
#ifndef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
226227
LLSERemoveTimeTaskData(scriptEngine);

0 commit comments

Comments
 (0)