fix: map ScrapingError to 502 Bad Gateway instead of 500 Internal Server Error; fix downr.org Cloudflare block; fix YouTube savetube DNS failure; fix twitter/pinterest error handling

This commit is contained in:
asepharyana
2026-09-01 11:26:29 +07:00
parent 763a641593
commit c3e6537a63
2 changed files with 106 additions and 1 deletions
+5 -1
View File
@@ -135,6 +135,10 @@ impl IntoResponse for AppError {
impl From<ScrapingError> for AppError {
fn from(e: ScrapingError) -> Self {
AppError::Internal(format!("{}", e))
// Map ScrapingError::Http to BAD_GATEWAY (502) — the scraper code
// correctly returns DownloadResult::error for client-side issues
// (invalid URL, bad format), so any ScraperError that escapes is
// an upstream provider failure, not a local bug.
AppError::ScraperError(e.to_string())
}
}