metarhia / metavm

Script loader with isolated sandboxes for node.js 📦
https://metarhia.com
MIT License
42 stars 7 forks source link

Fix 1 line shift in stack traces #101

Closed tshemsedinov closed 1 year ago

tshemsedinov commented 1 year ago

For example:

14:05:18  W2   error   127.0.0.1    POST    /api    500 
500 TypeError: Cannot destructure property 'token' of 'session' as it is undefined.
  method (/application/api/example.1/getClientInfo.js:7:13)
  Procedure.invoke (/node_modules/impress/lib/procedure.js:76:22)
  HttpChannel.rpc (/node_modules/metacom/lib/channel.js:247:27)
  processTicksAndRejections (internal/process/task_queues.js:95:5)

while getClientInfo.js have destructuring at line 6

({
  access: 'public',
  method: async () => {
    const { uuid, session, client } = context;
    const { ip } = client;
    const { token, accountId } = session;
    return { result: { ip, token, accountId, uuid } };
  },
});
tshemsedinov commented 1 year ago

Everything works well as of now