mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-08-19 02:07:14 +02:00
improve error handling
This commit is contained in:
@@ -11,17 +11,17 @@ async function webView(req: express.Request, res: express.Response) {
|
||||
if (!repo) return;
|
||||
try {
|
||||
if (!repo.options.page) {
|
||||
throw "page_not_activated";
|
||||
throw new Error("page_not_activated");
|
||||
}
|
||||
if (!repo.options.pageSource) {
|
||||
throw "page_not_activated";
|
||||
throw new Error("page_not_activated");
|
||||
}
|
||||
|
||||
if (
|
||||
repo.options.pageSource?.branch !=
|
||||
(repo.source as GitHubDownload).branch.name
|
||||
) {
|
||||
throw "page_not_supported_on_different_branch";
|
||||
throw new Error("page_not_supported_on_different_branch");
|
||||
}
|
||||
|
||||
let requestPath = path.join(
|
||||
|
||||
Reference in New Issue
Block a user