Allow generic Data param at RpcError (#4665)

* Allow generic Data param at RpcError

* Ensure that unless `Data` is specified, the field can't be accessed
This commit is contained in:
MOZGIII
2022-03-18 16:33:14 +02:00
committed by GitHub
parent f83d23d0f6
commit b0e8a8512a
3 changed files with 14 additions and 6 deletions
@@ -56,6 +56,14 @@ describe('RpcError', (): void => {
new RpcError('test message', 1234, data).data
).toEqual(data);
});
it('sets the .data property to generic value', (): void => {
const data = { custom: 'value' } as const;
expect(
new RpcError('test message', 1234, data).data
).toEqual(data);
});
});
describe('stack traces', (): void => {