-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1488 from cloudflare/jsnell/more-worker-h-cleanup
- Loading branch information
Showing
8 changed files
with
58 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <kj/string.h> | ||
|
||
namespace workerd { | ||
|
||
enum class UncaughtExceptionSource { | ||
INTERNAL, | ||
INTERNAL_ASYNC, | ||
// We catch, log, and rethrow some exceptions at these intermediate levels, in case higher-level | ||
// handlers fail. | ||
|
||
ASYNC_TASK, | ||
REQUEST_HANDLER, | ||
TRACE_HANDLER, | ||
ALARM_HANDLER, | ||
}; | ||
|
||
inline kj::StringPtr KJ_STRINGIFY(UncaughtExceptionSource value) { | ||
switch (value) { | ||
case UncaughtExceptionSource::INTERNAL: return "Uncaught"_kj; | ||
case UncaughtExceptionSource::INTERNAL_ASYNC: return "Uncaught (in promise)"_kj; | ||
case UncaughtExceptionSource::ASYNC_TASK: return "Uncaught (async)"_kj; | ||
case UncaughtExceptionSource::REQUEST_HANDLER: return "Uncaught (in response)"_kj; | ||
case UncaughtExceptionSource::TRACE_HANDLER: return "Uncaught (in trace)"_kj; | ||
case UncaughtExceptionSource::ALARM_HANDLER: return "Uncaught (in alarm)"_kj; | ||
}; | ||
KJ_UNREACHABLE; | ||
} | ||
|
||
} // namespace workerd |