From 5761b90f3c7d66f5a93aef57e6a21feb807d24bf Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 3 Dec 2021 20:36:47 +0100 Subject: Add an `OS.crash()` method for testing system crash handler This makes it possible to test the system's crash handler without having to modify engine code or exploit an engine bug. --- doc/classes/OS.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'doc/classes') diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 7088844547..a5bd8e2768 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -31,6 +31,13 @@ [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + + + + + Crashes the engine (or the editor if called within a [code]@tool[/code] script). This should [i]only[/i] be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) [method @GDScript.assert], [method @GlobalScope.push_error] or [method alert]. See also [method kill]. + + @@ -374,7 +381,7 @@ - Kill (terminate) the process identified by the given process ID ([code]pid[/code]), e.g. the one returned by [method execute] in non-blocking mode. + Kill (terminate) the process identified by the given process ID ([code]pid[/code]), e.g. the one returned by [method execute] in non-blocking mode. See also [method crash]. [b]Note:[/b] This method can also be used to kill processes that were not spawned by the game. [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. -- cgit v1.2.3