Seems like it should be simple.
Trying:
res.status(500).send({ error: "That type already exists." })
Gets me:
TypeError: res.status is not a function
This is in sapper, not sure if that makes a diff.
According to the docs, you use res.statusCode = 500, or if you're throwing an error in a middleware, you'd use err.code = 500.
res.statusCode = 500
err.code = 500
1.4m articles
1.4m replys
5 comments
56.9k users