better logging and delay
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user