File tree 1 file changed +5
-11
lines changed 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,6 @@ export interface FluenceConnectionOptions {
54
54
dialTimeout ?: number ;
55
55
}
56
56
57
- export class VersionIncompatibleError extends Error {
58
- __proto__ : Error ;
59
- constructor ( ) {
60
- const trueProto = new . target . prototype ;
61
- super ( 'Current version of JS SDK is incompatible with the connected Fluence node. Please update JS SDK' ) ;
62
- this . __proto__ = trueProto ;
63
- }
64
- }
65
-
66
57
export class FluenceConnection {
67
58
private readonly selfPeerId : PeerId ;
68
59
private node : Peer ;
@@ -128,8 +119,11 @@ export class FluenceConnection {
128
119
try {
129
120
await this . node . dial ( this . address ) ;
130
121
} catch ( e ) {
131
- if ( e . name === 'AggregateError' && e . _errors [ 0 ] . code === 'ERR_ENCRYPTION_FAILED' ) {
132
- throw new VersionIncompatibleError ( ) ;
122
+ if ( e . name === 'AggregateError' && e . _errors . length === 1 ) {
123
+ const error = e . _errors [ 0 ] ;
124
+ throw `Error dialing node ${ this . address } :\n${ error . code } \n${ error . message } ` ;
125
+ } else {
126
+ throw e ;
133
127
}
134
128
}
135
129
You can’t perform that action at this time.
0 commit comments