babalae/better-genshin-impact · error · TimeoutException
识别元素在 {actualTimeout}ms 后超时未消失!
Error message
识别元素在 {actualTimeout}ms 后超时未消失! What it means
Thrown by LoadSourceAsync in MarkdownView when FilePath is set (not Markdown), the resolved file path does not exist on disk. This is a MarkdownRenderException, the view's domain exception type, indicating the Markdown source file is missing. It fires after FilePath and BasePath are resolved via ResolveFilePath.
Source
Thrown at BetterGenshinImpact/Core/BgiVision/BvLocator.cs:215
var actualTimeout = timeout ?? _timeout ?? DefaultTimeout;
var actualRetryInterval = _retryInterval ?? DefaultRetryInterval;
var retryCount = Math.Max(1, actualTimeout / actualRetryInterval);
var retryRes = await NewRetry.WaitForAction(async () =>
{
var results = FindAll();
var b = results.Count == 0;
if (!b && RetryAction != null)
{
await RetryAction(results);
}
return b;
}, _cancellationToken, retryCount, actualRetryInterval);
if (!retryRes)
{
throw new TimeoutException($"识别元素在 {actualTimeout}ms 后超时未消失!");
}
}
public async Task TryWaitForDisappear(int? timeout = null)
{
try
{
await WaitForDisappear(timeout);
}
catch
{
// ignored
}
}
/// <summary>
/// 方便优雅的设置感兴趣区域 (ROI)
/// 该方法会覆盖 RecognitionObject.RegionOfInterest 的值。View on GitHub (pinned to a7cb36712d)
Solutions
- Verify the resolved filePath is correct (log it before the File.Exists check).
- Ensure FilePath is absolute, or that BasePath correctly points to the containing directory.
- Restore the missing file or update FilePath to the correct location.
- Handle the exception in the RenderFailedCommand to show a user-friendly message.
Example fix
// before
var filePath = ResolveFilePath(FilePath!, BasePath);
if (!File.Exists(filePath))
throw new MarkdownRenderException($"Markdown 文件不存在:{filePath}");
// after — check and raise diagnostic event instead
var filePath = ResolveFilePath(FilePath!, BasePath);
if (!File.Exists(filePath))
{
ReportResourceDiagnostic(new MarkdownDiagnostic(
MarkdownDiagnosticSeverity.Error,
$"Markdown 文件不存在:{filePath}",
Source: FilePath));
return null;
} Defensive patterns
Strategy: validation
Validate before calling
// Validate FilePath exists before rendering
var resolved = ResolveFilePath(FilePath, BasePath);
if (!File.Exists(resolved))
ReportResourceDiagnostic(new MarkdownDiagnostic(Error, $"文件不存在:{resolved}")); Type guard
bool IsMarkdownFileAvailable() =>
!string.IsNullOrWhiteSpace(FilePath) && File.Exists(ResolveFilePath(FilePath, BasePath)); Try / catch
try { source = await LoadSourceAsync(ct); }
catch (MarkdownRenderException ex) { ReportResourceDiagnostic(...); source = null; } Prevention
- Use absolute paths or validate BasePath before binding FilePath.
- Handle MarkdownRenderException in RenderFailedCommand to show user-facing messages.
- Verify file existence on FilePath change before triggering render.
When it happens
Trigger: LoadSourceAsync resolves filePath = ResolveFilePath(FilePath, BasePath); File.Exists returns false. Triggered when the FilePath property points to a moved/deleted/renamed .md file, or BasePath is wrong so the combined path is invalid.
Common situations: The Markdown file was moved or deleted after the FilePath was set, a relative FilePath with a missing/wrong BasePath resolves to a non-existent location, or the path has encoding/escaping issues on the filesystem.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- 等待 {targetDescription} 超时({timeout}ms)
- 当前动作已经设置完成条件,不能再次修改或添加
- 文件 '{relativePath}' 不存在
- 添加流程步骤后不能修改流程默认配置
- 没有可用的上一步识别位置,无法执行隐式坐标操作
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/9eec375eb947d201.
Report an issue: GitHub.