metarhia / metacom

RPC communication protocol for Metarhia stack 🔌
https://metarhia.com
MIT License
80 stars 40 forks source link

Fix proc timeout reached error detection #464

Closed aliendrew closed 1 year ago

aliendrew commented 1 year ago

Related to changes made in https://github.com/metarhia/metautil/commit/e4a521a49c0b16d02bfd42f06b2bed0a27d2bbed

aliendrew commented 1 year ago

For example this api:

({
  parameters: {
    a: 'number',
    b: 'number',
  },
  timeout: 100,
  method: async ({ a, b }) => {
    const result = a + b;
    await node.timers.promises.setTimeout(150);
    return result;
  },

  returns: 'number',
});

will log client error: 500 Error: Timeout of 100ms reached but should be: 408 Error: Timeout of 100ms reached

tshemsedinov commented 1 year ago

To be landed after https://github.com/metarhia/metautil/pull/195

FYI: @aliendrew see changes in this PR and PR mentioned above