only show error string on page requests

This commit is contained in:
David Reed 2022-12-30 16:51:53 -05:00
parent d70d089f39
commit ba0dbbd83a
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F

View file

@ -249,7 +249,11 @@ class UVServiceWorker extends Ultraviolet.EventEmitter {
statusText: responseCtx.statusText,
});
} catch (err) {
if (!['document', 'iframe'].includes(request.destination))
return new Response(undefined, { status: 500 });
console.error(err);
return new Response(err.toString(), {
status: 500,
});