From 6f7cbd696d55b8bff0589bba95706f9b7c3fba8f Mon Sep 17 00:00:00 2001 From: Elin Angelow Date: Mon, 29 Apr 2024 10:57:13 +0300 Subject: [PATCH] fix: more info in error --- lib/methods/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/methods/index.js b/lib/methods/index.js index cae63d4..fd6971c 100644 --- a/lib/methods/index.js +++ b/lib/methods/index.js @@ -163,6 +163,7 @@ const Methods = ({ * @returns {any} */ async test(data, ctx) { + const callData = {...data}; const m = this.find({name: data.method}); if (m) { this.log('debug', 'Found', data.method, data); @@ -187,8 +188,8 @@ const Methods = ({ mr.params = r; } catch (e) { mr.params = undefined; - mr.error = e?.error || e; - this.log('error', 'Methods', mr.error); + mr.error = e?.error?.stack || e?.stack; + this.log('error', 'Methods', mr.error, callData); } if (!data.id) { return;