From db86507ef9bcefd0f89b627bf088df9e161311d2 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Sun, 28 Aug 2016 09:56:46 -0700 Subject: [PATCH 1/3] Fix: correct babel-polyfill version This installs the babel-polyfill for babel 6. #oops --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index b64af0b..48ddb4c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ if (!global._babelPolyfill) { - require('babel/polyfill'); + require('babel-polyfill'); } import crud, { associations } from './crud'; -- 2.34.1 From ce6f1fedde380c22f1d802dfbdf36e8a34448e1d Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Sun, 28 Aug 2016 09:57:23 -0700 Subject: [PATCH 2/3] Fix: bad merge in error.js --- src/error.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/error.js b/src/error.js index dcdfe20..af49e86 100644 --- a/src/error.js +++ b/src/error.js @@ -1,8 +1,4 @@ -<<<<<<< b18479e02e3d47da4e40369a8132e07125eb96a3 import Boom from 'boom'; -======= -import { wrap } from 'boom'; ->>>>>>> whatever export default (target, key, descriptor) => { const fn = descriptor.value; @@ -11,7 +7,6 @@ export default (target, key, descriptor) => { try { await fn(request, reply); } catch (e) { -<<<<<<< b18479e02e3d47da4e40369a8132e07125eb96a3 if (e.original) { const { code, detail } = e.original; @@ -50,23 +45,6 @@ export default (target, key, descriptor) => { reply(err); } else { reply(e); -======= - const { code, detail } = e.original; - - // pg error codes https://www.postgresql.org/docs/9.5/static/errcodes-appendix.html - if (code && (code.startsWith('22') || code.startsWith('23'))) { - const error = wrap(e, 406); - - // detail tends to be more specific information. So, if we have it, use. - if (detail) { - error.message += `: ${detail}`; - error.reformat(); - } - - reply(error); - } else { - reply(wrap(e)); ->>>>>>> whatever } } }; -- 2.34.1 From a9fa790ae98846d57b7d71855fe7f6cc2f32632b Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Sun, 28 Aug 2016 09:58:08 -0700 Subject: [PATCH 3/3] Fix (deps): install babel-polyfill as optionalDep We only require it if something else hasn't so this is a optionalDep. --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 7dabbab..94723b3 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,8 @@ "boom": "^3.2.2", "joi": "7.2.1", "lodash": "4.0.0" + }, + "optionalDependencies": { + "babel-polyfill": "^6.13.0" } } -- 2.34.1