This is an example showing a bug in RunKit's error handling for endpoints.
Specifically, while RunKit's use of Domains [0] is able to catch errors thrown directly by the exports.endpoint(req, res) function [1], RunKit is unable to catch errors thrown asynchronously [2]. This is not a language limitation, it's straightforward to manually use a Domain to catch the error [3], and RunKit should be doing exactly that.
[0]: https://nodejs.org/api/domain.html
[1]: https://runkit.io/laughinghan/58337152a62a08001304609a/branches/master/good_caught_error
(you can see the use of a Domain in the stacktrace)
[2]: https://runkit.io/laughinghan/58337152a62a08001304609a/branches/master/uncaught_error
[3]: https://runkit.io/laughinghan/58337152a62a08001304609a/branches/master/manually_caught_error
(The full workaround is slightly less straightforward, see the code for the full workaround including an edge case with an event handler and non-empty POST requests.)