We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e5762e commit c7bbb3dCopy full SHA for c7bbb3d
src/index.js
@@ -73,7 +73,11 @@ const getHostingType = () => getEnv().hostingType || 'localhost'
73
const fnToPromise = fn => (req, res) => new Promise((onSuccess, onFailure) => {
74
try {
75
if (fn.length < 3)
76
- Promise.resolve(fn(req, res)).then(() => onSuccess())
+ Promise.resolve(fn(req, res))
77
+ .then(() => onSuccess())
78
+ .catch(err => {
79
+ onFailure(err)
80
+ })
81
else
82
fn(req, res, onSuccess)
83
}
0 commit comments