From e189c1b728d8fd2742acc4d807e7559e807814fd Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Mon, 15 Oct 2018 02:08:49 -0500 Subject: [PATCH] fix: revert #2744 see #2848, fixes issues with stack not displaying correctly --- src/rest/APIRouter.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/rest/APIRouter.js b/src/rest/APIRouter.js index 678f2fe70..06ebeb3f9 100644 --- a/src/rest/APIRouter.js +++ b/src/rest/APIRouter.js @@ -11,13 +11,6 @@ function buildRoute(manager) { get(target, name) { if (reflectors.includes(name)) return () => route.join('/'); if (methods.includes(name)) { - // Preserve async stack - let stackTrace = null; - if (Error.captureStackTrace) { - stackTrace = {}; - Error.captureStackTrace(stackTrace, this.get); - } - return options => manager.request(name, route.join('/'), Object.assign({ versioned: manager.versioned, route: route.map((r, i) => { @@ -25,14 +18,7 @@ function buildRoute(manager) { if (route[i - 1] === 'reactions') return ':reaction'; return r; }).join('/'), - }, options)).catch(error => { - if (stackTrace && (error instanceof Error)) { - stackTrace.name = error.name; - stackTrace.message = error.message; - error.stack = stackTrace.stack; - } - throw error; - }); + }, options)); } route.push(name); return new Proxy(noop, handler);