Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch and log all uncaught exceptions propagated from simpleUpdate(). #1952

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion jme3-core/src/main/java/com/jme3/app/SimpleApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
import com.jme3.system.JmeContext.Type;
import com.jme3.system.JmeSystem;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
* <code>SimpleApplication</code> is the base class for all jME3 Applications.
* <code>SimpleApplication</code> will display a statistics view
Expand All @@ -65,6 +68,8 @@
*/
public abstract class SimpleApplication extends LegacyApplication {

private static final Logger logger = Logger.getLogger(SimpleApplication.class.getName());

public static final String INPUT_MAPPING_EXIT = "SIMPLEAPP_Exit";
public static final String INPUT_MAPPING_CAMERA_POS = DebugKeysAppState.INPUT_MAPPING_CAMERA_POS;
public static final String INPUT_MAPPING_MEMORY = DebugKeysAppState.INPUT_MAPPING_MEMORY;
Expand Down Expand Up @@ -258,7 +263,12 @@ public void update() {
stateManager.update(tpf);

// simple update and root node
simpleUpdate(tpf);
try{
simpleUpdate(tpf);
}catch(Exception e){
logger.log(Level.WARNING, "Uncaught exception in simpleUpdate():", e);
throw e;
}

if (prof != null)
prof.appStep(AppStep.SpatialUpdate);
Expand Down