New API responses with good errors
This commit is contained in:
10
server/errors.js
Normal file
10
server/errors.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import httpErrors from 'http-errors';
|
||||
|
||||
const apiError = (code, id, message) => {
|
||||
return httpErrors(code, message, { id });
|
||||
};
|
||||
|
||||
export default apiError;
|
||||
export {
|
||||
httpErrors,
|
||||
};
|
||||
Reference in New Issue
Block a user