Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }).catch((err) => {
- switch(err.message) {
- case 'NOT_ENOUGH_ITEMS':
- return res.status(400).json("Not enough items on market.")
- case 'INSUFFICIENT_FUNDS':
- return res.status(400).json("Insufficient funds.")
- case 'BUYING_OWN_EQUIPMENT':
- return res.status(400).json("You can't buy your own item.")
- default:
- console.log(err)
- return res.status(400).json('Unexpected error, please contact an administrator')
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement