diff --git a/lib/index.js b/lib/index.js index 8823650..d4becdd 100755 --- a/lib/index.js +++ b/lib/index.js @@ -63,10 +63,13 @@ function maskField(field, fn) { } field[Processed] = true; - field.resolve = async function (...args) { + field.resolve = function (...args) { try { - const out = resolveFn.call(this, ...args); - return await Promise.resolve(out); + let out = resolveFn.call(this, ...args); + if (out && typeof out.then === 'function') { + out = out.then(undefined, e => fn(e, args)); + } + return out; } catch (e) { throw fn(e, args); }