diff --git a/Source/UE5Coro/Private/Generator.cpp b/Source/UE5Coro/Private/Generator.cpp index 7de780d..f463832 100644 --- a/Source/UE5Coro/Private/Generator.cpp +++ b/Source/UE5Coro/Private/Generator.cpp @@ -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 diff --git a/Source/UE5Coro/Private/Promise.cpp b/Source/UE5Coro/Private/Promise.cpp index 638fc4c..35df385 100644 --- a/Source/UE5Coro/Private/Promise.cpp +++ b/Source/UE5Coro/Private/Promise.cpp @@ -168,7 +168,11 @@ void FPromise::AddContinuation(std::function 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;