From 76f0d4d03a0c13e4cab73c1929b1daf9f776cd18 Mon Sep 17 00:00:00 2001 From: Raiyn Aydin Date: Sat, 17 Oct 2026 21:31:03 +0800 Subject: [PATCH] fix(readnovelfull): throw on failed novel and chapter requests parseNovel and parseChapter ignored the HTTP status, so a 404 (e.g. an AllNovel novel saved from allnovel.org that novelfull.com does not carry) rendered as an empty novel or an empty chapter. Throw with the status instead, with a clear "not found" message for 404. Closes #2673 --- plugins/multisrc/readnovelfull/template.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/multisrc/readnovelfull/template.ts b/plugins/multisrc/readnovelfull/template.ts index 24aa4b262..47a205721 100644 --- a/plugins/multisrc/readnovelfull/template.ts +++ b/plugins/multisrc/readnovelfull/template.ts @@ -54,7 +54,7 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase { this.icon = `multisrc/readnovelfull/${metadata.id.toLowerCase()}/icon.png`; this.site = metadata.sourceSite; const versionIncrements = metadata.options?.versionIncrements || 0; - this.version = `2.2.${1 + versionIncrements}`; + this.version = `2.2.${2 + versionIncrements}`; this.options = metadata.options; this.filters = metadata.filters; if (this.options?.imageReferer) { @@ -380,6 +380,13 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase { async parseNovel(novelPath: string): Promise { const url = this.site + novelPath; const result = await fetchApi(url); + if (!result.ok) { + throw new Error( + result.status === 404 + ? 'Novel not found (404), it may have been removed from this source.' + : `Could not reach site (${result.status}: ${result.statusText}) try to open in webview.`, + ); + } const body = await result.text(); const novel: Partial = { @@ -766,6 +773,13 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase { async parseChapter(chapterPath: string): Promise { const response = await fetchApi(this.site + chapterPath); + if (!response.ok) { + throw new Error( + response.status === 404 + ? 'Chapter not found (404), it may have been removed from this source.' + : `Could not reach site (${response.status}: ${response.statusText}) try to open in webview.`, + ); + } let html = await response.text(); if (this.options?.customJs) { try {