Skip to content

Commit

Permalink
Updated error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Dec 8, 2024
1 parent f93bb83 commit b6b705f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function initializeParams(request, env) {
globalThis.urlOrigin = url.origin;
globalThis.dohURL = env.DOH_URL || 'https://cloudflare-dns.com/dns-query';
if (pathName !== '/secrets') {
if (!userID || !trojanPassword) throw new Error(`Please set UUID and Trojan password first. Please go to 🟢 https://${hostName}/secrets 🟢 to generate them.`, { cause: "init"});
if (!userID || !trojanPassword) throw new Error(`Please set UUID and Trojan password first. Please visit <a href="https://${hostName}/secrets" target="_blank">here</a> to generate them.`, { cause: "init"});
if (userID && !isValidUUID(userID)) throw new Error(`Invalid UUID: ${userID}`, { cause: "init"});
if (typeof env.bpb !== 'object') throw new Error('KV Dataset is not properly set! Please refer to tutorials.', { cause: "init"});
}
Expand Down

0 comments on commit b6b705f

Please sign in to comment.