New API responses with good errors

This commit is contained in:
Jori Lallo
2016-09-17 14:53:30 -07:00
parent e631025887
commit fcc83dd2d6
11 changed files with 86 additions and 50 deletions

10
server/errors.js Normal file
View 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,
};