mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 07:34:27 +00:00
Catch LuaError
when loading scene groups
This commit is contained in:
parent
9c77ddc42e
commit
3e6b38c407
@ -15,6 +15,7 @@ import javax.script.ScriptException;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
import org.luaj.vm2.LuaError;
|
||||||
import org.luaj.vm2.LuaValue;
|
import org.luaj.vm2.LuaValue;
|
||||||
|
|
||||||
@ToString
|
@ToString
|
||||||
@ -165,11 +166,13 @@ public final class SceneGroup {
|
|||||||
|
|
||||||
// Add monsters and gadgets to suite
|
// Add monsters and gadgets to suite
|
||||||
this.suites.forEach(i -> i.init(this));
|
this.suites.forEach(i -> i.init(this));
|
||||||
|
|
||||||
} catch (ScriptException e) {
|
} catch (ScriptException e) {
|
||||||
Grasscutter.getLogger()
|
Grasscutter.getLogger()
|
||||||
.error(
|
.error(
|
||||||
"An error occurred while loading group " + this.id + " in scene " + sceneId + ".", e);
|
"An error occurred while loading group " + this.id + " in scene " + sceneId + ".", e);
|
||||||
|
} catch (LuaError luaError) {
|
||||||
|
Grasscutter.getLogger().error("An error occurred while loading group %s in scene %s."
|
||||||
|
.formatted(this.id, sceneId), luaError);
|
||||||
}
|
}
|
||||||
|
|
||||||
Grasscutter.getLogger().debug("Successfully loaded group {} in scene {}.", this.id, sceneId);
|
Grasscutter.getLogger().debug("Successfully loaded group {} in scene {}.", this.id, sceneId);
|
||||||
|
Loading…
Reference in New Issue
Block a user