fix(player): downgrade search candidate failure logging and suppress benign telemetry

- Downgrade exploratory candidate query errors in SearchMixin._searchFreeText from logger.warn to logger.player
- Safely extract error description when Lavalink search rejects with non-standard error shapes
- Guard against null result.tracks in Player.search()
- Add ErrorChannel suppression for benign player search candidate misses
This commit is contained in:
NoLogicAlan committed 2026-11-15 00:42:35 +03:00
1 parent 5ac04535f3
commit 5e39679f45
2 files changed
+6 -2

No files matched your search

+2
View File
@@ -292,6 +292,8 @@ function _forward(level, tag, args) {
if (tag.includes("[LastFm]") && (/not found|error 6:/i.test(body) || /Track not found/i.test(body))) return;
/* Suppress transient socket drops from routine status channel updates */
if (tag.includes("[StatusChannel]") && (/other side closed/i.test(body) || /fetch failed/i.test(body))) return;
/* Suppress benign search fallback and candidate exploration warnings */
if (tag.includes("[Player]") && (/Free text search candidate/i.test(tag) || /search candidate.*failed/i.test(tag))) return;
const now = Date.now();
const key = `${level}|${tag}|${(body || tag).slice(0, 200)}`;
const last = _forwardDedup.get(key);
+4 -2
View File
@@ -382,7 +382,9 @@ const SearchMixin = {
return res;
}
} catch (err) {
logger.warn(`[Player] Free text search candidate "${candidate}" failed (${source}):`, err?.message);
/* Search candidate exploration is a normal fallback mechanism; log as player diagnostic */
const errMsg = err?.message || err?.error || (typeof err === "string" ? err : "") || "unknown error";
logger.player(`[Player] Free text search candidate "${candidate}" failed (${source}):`, errMsg);
}
}
return null;
@@ -650,7 +652,7 @@ const SearchMixin = {
try {
const source = this._getSource(provider);
const result = await this._searchFreeText(query, source);
return result.tracks || [];
return result?.tracks || [];
} catch (e) {
logger.error(`[Player] lavalink search error:`, e?.message);
return [];