Skip to content

Commit fc5bee7

Browse files
fix error msgs in service config validation
1 parent 1e31c0f commit fc5bee7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/grpc-js/src/service-config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function validateRetryPolicy(obj: any): RetryPolicy {
143143
!DURATION_REGEX.test(obj.initialBackoff)
144144
) {
145145
throw new Error(
146-
'Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer followed by s'
146+
'Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s'
147147
);
148148
}
149149
if (
@@ -152,7 +152,7 @@ function validateRetryPolicy(obj: any): RetryPolicy {
152152
!DURATION_REGEX.test(obj.maxBackoff)
153153
) {
154154
throw new Error(
155-
'Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer followed by s'
155+
'Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s'
156156
);
157157
}
158158
if (
@@ -228,18 +228,18 @@ function validateHedgingPolicy(obj: any): HedgingPolicy {
228228
if (typeof value === 'number') {
229229
if (!Object.values(Status).includes(value)) {
230230
throw new Error(
231-
'Invlid method config hedging policy: nonFatalStatusCodes value not in status code range'
231+
'Invalid method config hedging policy: nonFatalStatusCodes value not in status code range'
232232
);
233233
}
234234
} else if (typeof value === 'string') {
235235
if (!Object.values(Status).includes(value.toUpperCase())) {
236236
throw new Error(
237-
'Invlid method config hedging policy: nonFatalStatusCodes value not a status code name'
237+
'Invalid method config hedging policy: nonFatalStatusCodes value not a status code name'
238238
);
239239
}
240240
} else {
241241
throw new Error(
242-
'Invlid method config hedging policy: nonFatalStatusCodes value must be a string or number'
242+
'Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number'
243243
);
244244
}
245245
}

0 commit comments

Comments
 (0)