mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-17 13:30:00 -04:00
only show error string on page requests
This commit is contained in:
parent
d70d089f39
commit
ba0dbbd83a
1 changed files with 4 additions and 0 deletions
|
@ -249,7 +249,11 @@ class UVServiceWorker extends Ultraviolet.EventEmitter {
|
||||||
statusText: responseCtx.statusText,
|
statusText: responseCtx.statusText,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
if (!['document', 'iframe'].includes(request.destination))
|
||||||
|
return new Response(undefined, { status: 500 });
|
||||||
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
||||||
return new Response(err.toString(), {
|
return new Response(err.toString(), {
|
||||||
status: 500,
|
status: 500,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue