Try catch in Godot 4

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By givenmnisi6

I get the error expected end of statement after expression, found “:” instead

Here’s the code:

try:
	$AudioStreamPlayer.stream = load("res://Audio/Voice/" + story[iStory] + str(totCount) + ".wav")
	$AudioStreamPlayer.play()
except e:
	pass

Hi
Are you sure try-except is a feature in Gdscript? I didn’t find anything about it

GameSchool | 2023-06-12 13:06

I cannot find any info about it, I think I will just use an in statement

givenmnisi6 | 2023-06-12 14:42

:bust_in_silhouette: Reply From: jgodfrey

Correct. GDScript does NOT have a try/catch mechanism.