Skip to content

Commit

Permalink
Demote unhandled_exception checks to checkSlow, encourage users to re…
Browse files Browse the repository at this point in the history
…move them if needed #26
  • Loading branch information
landelare committed Jul 8, 2024
1 parent 9e3a72f commit 5444a99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Source/UE5Coro/Private/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ using namespace UE5Coro::Private;
void FGeneratorPromise::unhandled_exception()
{
#if PLATFORM_EXCEPTIONS_DISABLED
check(!"Exceptions are not supported");
// Hitting this can be a result of the generator itself invoking undefined
// behavior, e.g., by using a bad pointer.
// On Windows, SEH exceptions can end up here if C++ exceptions are disabled.
// If this hinders debugging, feel free to remove it!
checkSlow(!"Unhandled exception from generator!");
#else
throw;
#endif
Expand Down
6 changes: 5 additions & 1 deletion Source/UE5Coro/Private/Promise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ void FPromise::AddContinuation(std::function<void(void*)> Fn)
void FPromise::unhandled_exception()
{
#if PLATFORM_EXCEPTIONS_DISABLED
check(!"Exceptions are not supported");
// Hitting this can be a result of the coroutine itself invoking undefined
// behavior, e.g., by using a bad pointer.
// On Windows, SEH exceptions can end up here if C++ exceptions are disabled.
// If this hinders debugging, feel free to remove it!
checkSlow(!"Unhandled exception from coroutine!");
#else
bUnhandledException = true;
throw;
Expand Down

0 comments on commit 5444a99

Please sign in to comment.