better logging and delay

This commit is contained in:
2026-01-29 00:55:18 -05:00
parent 3a66e3cd42
commit 394fa0b900
4 changed files with 63 additions and 22 deletions

View File

@@ -37,7 +37,12 @@ router.get('/search', authMiddleware, async (req, res) => {
);
if (!response.ok) {
throw new Error('TMDB API error');
const errorText = await response.text();
console.error('TMDB API error:', response.status, errorText);
return res.status(500).json({
error: `TMDB API error: ${response.status}`,
details: errorText
});
}
const data = await response.json();