We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
isInvalidArgument
ServiceError
1 parent d3306e0 commit a52bce2Copy full SHA for a52bce2
arduino-ide-extension/src/node/service-error.ts
@@ -21,6 +21,12 @@ export namespace ServiceError {
21
return is(arg) && arg.code === 1; // https://grpc.github.io/grpc/core/md_doc_statuscodes.html
22
}
23
24
+ export function isInvalidArgument(
25
+ arg: unknown
26
+ ): arg is ServiceError & { code: StatusCode.INVALID_ARGUMENT } {
27
+ return is(arg) && arg.code === 3; // https://grpc.github.io/grpc/core/md_doc_statuscodes.html
28
+ }
29
+
30
export function is(arg: unknown): arg is ServiceError {
31
return arg instanceof Error && isStatusObject(arg);
32
0 commit comments