1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Allow users to catch errors for android platforms and prevent exception throwing

This commit is contained in:
Xavier Sellier
2018-05-21 11:39:40 -04:00
parent b9d3926340
commit 6fc89d0ce3
4 changed files with 42 additions and 11 deletions

View File

@@ -190,6 +190,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
protected void onGLDrawFrame(GL10 gl) {}
protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call
protected void onError(final String type, final String functionName, final String details, final String filename, final int line) {}
public void registerMethods() {}
}
@@ -934,4 +935,11 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
mProgressFraction.setText(Helpers.getDownloadProgressString(progress.mOverallProgress,
progress.mOverallTotal));
}
public void emitErrorSignal(final String type, final String functionName, final String details, final String filename, final int line) {
// Allow users to use 3rd party modules to catch godot's errors.
for (int i = 0; i < singleton_count; i++) {
singletons[i].onError(type, functionName, details, filename, line);
}
}
}