Skip to content

Commit

Permalink
Add error handling and logging in admin route
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstech committed Apr 7, 2024
1 parent 5c4dbf3 commit b7a2975
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routes/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ module.exports = async (req, res) => {
'authorization': token
}
});
console.log(response)
data = await response.json();
res.render("admin", {user: user, users: data, message: ''})

} catch (error) {
console.log(error)
res.render("admin", {user: user, users: data, message: 'Error fetching bitches. Please try again later.'})
}
}

0 comments on commit b7a2975

Please sign in to comment.