Skip to content

Commit

Permalink
chore: returning response instead throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
yogyy committed Apr 15, 2024
1 parent b8fa13a commit 712aaf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pages/api/spotify/currently-playing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default async function spotify(req: NextApiRequest, res: NextApiResponse)
res.setHeader('Cache-Control', 'public, s-maxage=180, stale-while-revalidate=90');
return res.status(200).json(data);
} catch (error) {
throw error;
console.log(error);
return res.status(500).json({ message: 'Internal Server Error' });
}
}
3 changes: 2 additions & 1 deletion src/pages/api/spotify/last-played.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default async function spotify(req: NextApiRequest, res: NextApiResponse)
};
return res.status(200).json(data);
} catch (error) {
throw error;
console.log(error);
return res.status(500).json({ message: 'Internal Server Error' });
}
}

0 comments on commit 712aaf7

Please sign in to comment.