Commit 82a8bc37 authored by Matthew Gall's avatar Matthew Gall

Added exception handling for 404 mirrors to worker.js

parent 313c8d4a
......@@ -49,8 +49,17 @@ async function handleRequest(request) {
}
config = JSON.parse(config)
let endpoint = config[product]['endpoint']
try {
let endpoint = config[product]['endpoint']
}
catch (e) {
return new Response(`You tried to access a mirror we don't yet maintain. Please send your request to [email protected]`, {
headers: {
'Content-Type': 'text/plain'
}
})
}
return new Response(endpoint, {
headers: {
'Content-Type': 'text/plain'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment