Merge pull request #54840 from Calinou/mono-move-exception-policy-setting

This commit is contained in:
Rémi Verschelde 2021-11-10 18:33:18 +01:00 committed by GitHub
commit d209369fa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -1315,7 +1315,9 @@
</member> </member>
<member name="mono/profiler/enabled" type="bool" setter="" getter="" default="false"> <member name="mono/profiler/enabled" type="bool" setter="" getter="" default="false">
</member> </member>
<member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0"> <member name="mono/runtime/unhandled_exception_policy" type="int" setter="" getter="" default="0">
The policy to use for unhandled Mono (C#) exceptions. The default "Terminate Application" exits the project as soon as an unhandled exception is thrown. "Log Error" logs an error message to the console instead, and will not interrupt the project execution when an unhandled exception is thrown.
[b]Note:[/b] The unhandled exception policy is always set to "Log Error" in the editor, which also includes C# [code]tool[/code] scripts running within the editor as well as editor plugin code.
</member> </member>
<member name="navigation/2d/default_cell_size" type="int" setter="" getter="" default="10"> <member name="navigation/2d/default_cell_size" type="int" setter="" getter="" default="10">
Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size]. Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size].

View file

@ -2050,7 +2050,7 @@ bool Main::start() {
GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000); GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000);
GLOBAL_DEF("mono/profiler/args", "log:calls,alloc,sample,output=output.mlpd"); GLOBAL_DEF("mono/profiler/args", "log:calls,alloc,sample,output=output.mlpd");
GLOBAL_DEF("mono/profiler/enabled", false); GLOBAL_DEF("mono/profiler/enabled", false);
GLOBAL_DEF("mono/unhandled_exception_policy", 0); GLOBAL_DEF("mono/runtime/unhandled_exception_policy", 0);
#endif #endif
DocTools doc; DocTools doc;

View file

@ -504,7 +504,7 @@ void GDMono::_init_godot_api_hashes() {
} }
void GDMono::_init_exception_policy() { void GDMono::_init_exception_policy() {
PropertyInfo exc_policy_prop = PropertyInfo(Variant::INT, "mono/unhandled_exception_policy", PROPERTY_HINT_ENUM, PropertyInfo exc_policy_prop = PropertyInfo(Variant::INT, "mono/runtime/unhandled_exception_policy", PROPERTY_HINT_ENUM,
vformat("Terminate Application:%s,Log Error:%s", (int)POLICY_TERMINATE_APP, (int)POLICY_LOG_ERROR)); vformat("Terminate Application:%s,Log Error:%s", (int)POLICY_TERMINATE_APP, (int)POLICY_LOG_ERROR));
unhandled_exception_policy = (UnhandledExceptionPolicy)(int)GLOBAL_DEF(exc_policy_prop.name, (int)POLICY_TERMINATE_APP); unhandled_exception_policy = (UnhandledExceptionPolicy)(int)GLOBAL_DEF(exc_policy_prop.name, (int)POLICY_TERMINATE_APP);
ProjectSettings::get_singleton()->set_custom_property_info(exc_policy_prop.name, exc_policy_prop); ProjectSettings::get_singleton()->set_custom_property_info(exc_policy_prop.name, exc_policy_prop);