mirror of
https://github.com/headporter81/specialsource-homepage-backend.git
synced 2026-12-06 07:41:09 +09:00
fix : 봇 오류를 502 대신 500으로 (Worker가 502를 '서버 쉬는 중'으로 바꿔 버림)
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 55s
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 55s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c0090048c8
commit
25f583608d
1 file changed
+3
-2
@@ -121,12 +121,13 @@ public class MediaPostController {
|
|||||||
} catch (RestClientResponseException e) {
|
} catch (RestClientResponseException e) {
|
||||||
repository.delete(post);
|
repository.delete(post);
|
||||||
// 봇의 {"error": "..."} 를 그대로 전달 (예: 지원하지 않는 링크)
|
// 봇의 {"error": "..."} 를 그대로 전달 (예: 지원하지 않는 링크)
|
||||||
return ResponseEntity.status(e.getStatusCode().is4xxClientError() ? 400 : 502)
|
// ※ 502~504 금지: Cloudflare Worker가 "NAS 꺼짐"으로 보고 "서버가 쉬는 중" 화면으로 바꿔 버림 → 500
|
||||||
|
return ResponseEntity.status(e.getStatusCode().is4xxClientError() ? 400 : 500)
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.body(e.getResponseBodyAsString());
|
.body(e.getResponseBodyAsString());
|
||||||
} catch (RestClientException e) {
|
} catch (RestClientException e) {
|
||||||
repository.delete(post);
|
repository.delete(post);
|
||||||
return ResponseEntity.status(502).body(Map.of("error", "다운로드 봇에 연결할 수 없습니다"));
|
return ResponseEntity.status(500).body(Map.of("error", "다운로드 봇에 연결할 수 없습니다")); // 502 금지 (위 참고)
|
||||||
}
|
}
|
||||||
return ResponseEntity.ok(toResponse(post, false));
|
return ResponseEntity.ok(toResponse(post, false));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user