Skip to content

Commit b016a57

Browse files
committed
Check for task fault on completion
1 parent 8de1a8f commit b016a57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Runtime/Code/Luau/LuauCoreCallbacks.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,10 +1500,13 @@ private static int InvokeMethodAsync(LuauContext context, IntPtr thread, Type ty
15001500
Method = method,
15011501
Context = context,
15021502
};
1503-
1503+
15041504
if (task.IsCompleted) {
1505-
ResumeAsyncTask(awaitingTask, true);
15061505
shouldYield = false;
1506+
if (task.IsFaulted) {
1507+
return LuauError(thread, $"Error: Exception thrown in {type.Name} {method.Name}: {task.Exception.Message}");
1508+
}
1509+
ResumeAsyncTask(awaitingTask, true);
15071510
return 0;
15081511
}
15091512

0 commit comments

Comments
 (0)