mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-02 04:22:09 +08:00
Simplify error catching
This commit is contained in:
@@ -67,7 +67,7 @@ export default async function plexProxyHandler(req, res) {
|
||||
let [status, apiData] = await fetchFromPlexAPI("/status/sessions", widget);
|
||||
|
||||
if (status !== 200) {
|
||||
return res.status(status).json({error: {message: "HTTP error communicating with Plex API", data: apiData}});
|
||||
return res.status(status).json({error: {message: "HTTP error communicating with Plex API", data: Buffer.from(apiData).toString()}});
|
||||
}
|
||||
|
||||
if (apiData && apiData.MediaContainer) {
|
||||
|
||||
Reference in New Issue
Block a user