Skip to content

Commit b4cd2f5

Browse files
Bowl42claude
andcommitted
fix(search): use correct callback signature for error logging
The custom ajax `.then(success, error)` passes `(event, responseStatus)` not a standard Error. Use the response status for a more useful warning message, e.g. "(404)" instead of logging a ProgressEvent object. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 285a3b6 commit b4cd2f5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/plugins/search/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ export async function init(config, vm) {
338338
await saveData(config.maxAge, expireKey);
339339
}
340340
},
341-
async error => {
342-
console.warn(`[Docsify] Failed to fetch ${path} for search indexing`, error);
341+
async (_event, response) => {
342+
console.warn(`[Docsify] Failed to fetch ${path} for search indexing (${response?.status || 'network error'})`);
343343
if (len === ++count) {
344344
await saveData(config.maxAge, expireKey);
345345
}

0 commit comments

Comments
 (0)