Skip to content

Commit 06f475b

Browse files
committed
fixes after review
1 parent 3b6cd19 commit 06f475b

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/compat/v0_3/client/transports/grpc/grpc_transport.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class LegacyGrpcTransport implements Transport {
326326
options.signal.removeEventListener('abort', onAbort);
327327
}
328328
if (error) {
329-
return reject(LegacyGrpcTransport._mapToError(error, method));
329+
return reject(fromGrpcError(error, method));
330330
}
331331
try {
332332
resolve(converter(response));
@@ -371,7 +371,7 @@ export class LegacyGrpcTransport implements Transport {
371371
}
372372
} catch (error) {
373373
if (LegacyGrpcTransport._isServiceError(error)) {
374-
throw LegacyGrpcTransport._mapToError(error, method);
374+
throw fromGrpcError(error, method);
375375
}
376376
throw new Error(`GRPC error for ${String(method)}!`, { cause: error });
377377
} finally {
@@ -414,13 +414,4 @@ export class LegacyGrpcTransport implements Transport {
414414
};
415415
return toCoreStreamResponse(envelope);
416416
}
417-
418-
/**
419-
* Decodes `google.rpc.ErrorInfo` from `grpc-status-details-bin` when
420-
* present (this SDK's `legacyGrpcService` emits it); otherwise returns
421-
* `GrpcGenericError` preserving the gRPC code and details.
422-
*/
423-
private static _mapToError(error: grpc.ServiceError, method?: string): Error {
424-
return fromGrpcError(error, method);
425-
}
426417
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ export {
3636

3737
// Transport-agnostic error hierarchy: base class, semantic subclasses,
3838
// per-transport variants (Rest*/Grpc*/JsonRpc*), and `is*Error` type
39-
// guards. Also re-exported from `./client` and `./server`.
39+
// guards.
4040
export * from './errors/index.js';

0 commit comments

Comments
 (0)