Skip to content

bug(etl): _EtlRunLogController.Rerun 缺少錯誤處理,scheduler 例外會回 500 #359

@cct08311github

Description

@cct08311github

問題

_EtlRunLogController.Rerun 直接 await _scheduler.RerunFromSnapshotAsync(runLogId) 而沒有 try/catch。

對比 _EtlJobController.Abort 有正確包裹:

// Abort (正確)
try {
    await _scheduler.AbortAsync(id);
    return Ok(...);
} catch (InvalidOperationException ex) {
    return BadRequest(new { error = ex.Message });
}

Rerun 目前:

// Rerun (有問題)
await _scheduler.RerunFromSnapshotAsync(runLogId);
return Ok(...);
// ← 沒有任何錯誤處理

影響

runLogId 不存在、或 job 狀態不允許重跑時,scheduler 拋出 InvalidOperationException,框架會回傳 500 Internal Server Error 而非 400 Bad Request

預期行為

_EtlRunLogController.Rerun 應與 Abort 一致:捕獲 InvalidOperationException 並回傳 400。

發現方式

QA 測試覆蓋率審查(Issue #345

優先級

P2 — 反向路徑行為不一致,影響 API 合約

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2bugSomething isn't workingin-progressWork currently in progress

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions