is_dead_from_error

is_dead_from_error

Boolean value reflecting if the Sketch has been run and has now stopped because of an error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import time

def setup():
    py5.background(255, 0, 0)


print("the sketch is ready:", py5.is_ready)

py5.run_sketch()

print("the sketch is running:", py5.is_running)

py5.exit_sketch()

# wait for exit_sketch to complete
time.sleep(1)

print("the sketch is dead:", py5.is_dead)
print("did the sketch exit from an error?", py5.is_dead_from_error)

Description

Boolean value reflecting if the Sketch has been run and has now stopped because of an error. This will be True only when is_dead is True and the Sketch stopped because an exception was thrown.

Updated on March 22, 2022 21:53:01pm UTC