Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 7577170

Browse files
authored
Fix timeout error message (#103)
1 parent defe961 commit 7577170

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/__test__/unit/builtInHandler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ describe('Tests for default handler', () => {
3333
3434
${'peer'} | ${'timeout'} | ${[200, []]} | ${0} | ${[]}}
3535
${'peer'} | ${'timeout'} | ${[200, ['test']]} | ${0} | ${['test']}}
36-
${'peer'} | ${'timeout'} | ${[]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and an optional message string'}}
37-
${'peer'} | ${'timeout'} | ${[200, 'test', 1]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and an optional message string'}}
36+
${'peer'} | ${'timeout'} | ${[]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and a message string'}}
37+
${'peer'} | ${'timeout'} | ${[200, 'test', 1]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and a message string'}}
3838
3939
`.test(
4040
//

src/internal/defaultServices.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ export const defaultServices: { [serviceId in string]: { [fnName in string]: Gen
101101
peer: {
102102
timeout: (req) => {
103103
if (req.args.length !== 2) {
104-
return error(
105-
'timeout accepts exactly two arguments: timeout duration in ms and an optional message string',
106-
);
104+
return error('timeout accepts exactly two arguments: timeout duration in ms and a message string');
107105
}
108106
const durationMs = req.args[0];
109107
const message = req.args[1];

0 commit comments

Comments
 (0)