File tree Expand file tree Collapse file tree 2 files changed +5
-22
lines changed Expand file tree Collapse file tree 2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ class CommandPing extends CommandPolykey {
1919 this . action ( async ( nodeId : NodeId , options ) => {
2020 const { default : PolykeyClient } = await import ( '../../PolykeyClient' ) ;
2121 const nodesUtils = await import ( '../../nodes/utils' ) ;
22- const nodesErrors = await import ( '../../nodes/errors' ) ;
2322 const nodesPB = await import ( '../../proto/js/polykey/v1/nodes/nodes_pb' ) ;
2423 const clientOptions = await binProcessors . processClientOptions (
2524 options . nodePath ,
@@ -47,25 +46,11 @@ class CommandPing extends CommandPolykey {
4746 } ) ;
4847 const nodeMessage = new nodesPB . Node ( ) ;
4948 nodeMessage . setNodeId ( nodesUtils . encodeNodeId ( nodeId ) ) ;
50- let statusMessage ;
5149 let error ;
52- try {
53- statusMessage = await binUtils . retryAuthentication (
54- ( auth ) => pkClient . grpcClient . nodesPing ( nodeMessage , auth ) ,
55- meta ,
56- ) ;
57- } catch ( err ) {
58- if ( err . cause instanceof nodesErrors . ErrorNodeGraphNodeIdNotFound ) {
59- error = new binErrors . ErrorCLINodePingFailed (
60- `Failed to resolve node ID ${ nodesUtils . encodeNodeId (
61- nodeId ,
62- ) } to an address.`,
63- { cause : err } ,
64- ) ;
65- } else {
66- throw err ;
67- }
68- }
50+ const statusMessage = await binUtils . retryAuthentication (
51+ ( auth ) => pkClient . grpcClient . nodesPing ( nodeMessage , auth ) ,
52+ meta ,
53+ ) ;
6954 const status = { success : false , message : '' } ;
7055 status . success = statusMessage ? statusMessage . getSuccess ( ) : false ;
7156 if ( ! status . success && ! error ) {
Original file line number Diff line number Diff line change @@ -148,9 +148,7 @@ describe('ping', () => {
148148 expect ( exitCode ) . not . toBe ( 0 ) ; // Should fail if node doesn't exist.
149149 expect ( JSON . parse ( stdout ) ) . toEqual ( {
150150 success : false ,
151- message : `Failed to resolve node ID ${ nodesUtils . encodeNodeId (
152- fakeNodeId ! ,
153- ) } to an address.`,
151+ message : `No response received` ,
154152 } ) ;
155153 } ,
156154 globalThis . failedConnectionTimeout ,
You can’t perform that action at this time.
0 commit comments