File tree 1 file changed +13
-18
lines changed
packages/core/src/lib/metadata
1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,17 @@ class Metadata extends BaseProtocol {
40
40
async ( source ) => await all ( source )
41
41
) ;
42
42
43
- try {
44
- const bytes = new Uint8ArrayList ( ) ;
45
- res . forEach ( ( chunk ) => {
46
- bytes . append ( chunk ) ;
47
- } ) ;
43
+ const bytes = new Uint8ArrayList ( ) ;
44
+ res . forEach ( ( chunk ) => {
45
+ bytes . append ( chunk ) ;
46
+ } ) ;
48
47
49
- const shardInfoRes = proto_metadata . WakuMetadataResponse . decode ( bytes ) ;
50
- if ( ! shardInfoRes ) {
51
- throw new Error ( "WakuMetadata response is undefined" ) ;
52
- }
53
- if ( ! shardInfoRes . clusterId ) {
54
- throw new Error ( "WakuMetadata response clusterId is undefined" ) ;
55
- }
56
- } catch ( e ) {
57
- log . error ( `Error decoding response: ${ e } ` ) ;
58
- throw e ;
48
+ const shardInfoRes = proto_metadata . WakuMetadataResponse . decode ( bytes ) ;
49
+ if ( ! shardInfoRes ) {
50
+ throw new Error ( "WakuMetadata response is undefined" ) ;
51
+ }
52
+ if ( ! shardInfoRes . clusterId ) {
53
+ throw new Error ( "WakuMetadata response clusterId is undefined" ) ;
59
54
}
60
55
}
61
56
@@ -88,9 +83,9 @@ class Metadata extends BaseProtocol {
88
83
}
89
84
90
85
return response as ShardInfo ;
91
- } catch ( err ) {
92
- log . error ( "Error decoding metadata response" , err ) ;
93
- throw err ;
86
+ } catch ( error ) {
87
+ log . error ( "Error decoding metadata response" , error ) ;
88
+ throw error ;
94
89
}
95
90
}
96
91
}
You can’t perform that action at this time.
0 commit comments