File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -775,13 +775,14 @@ export class MeshDevice {
775
775
} ,
776
776
} ) ;
777
777
778
- return this . sendRaw ( toBinary ( Protobuf . Mesh . ToRadioSchema , toRadio ) )
779
- . catch ( ( e ) => {
778
+ return this . sendRaw ( toBinary ( Protobuf . Mesh . ToRadioSchema , toRadio ) ) . catch (
779
+ ( e ) => {
780
780
if ( this . deviceStatus === DeviceStatusEnum . DeviceDisconnected ) {
781
- throw new Error ( ' Device connection lost' ) ;
781
+ throw new Error ( " Device connection lost" ) ;
782
782
}
783
783
throw e ;
784
- } ) ;
784
+ } ,
785
+ ) ;
785
786
}
786
787
787
788
/**
@@ -810,8 +811,8 @@ export class MeshDevice {
810
811
this . _heartbeatIntervalId = setInterval ( ( ) => {
811
812
this . heartbeat ( ) . catch ( ( err ) => {
812
813
this . log . error (
813
- Emitter [ Emitter . Ping ] ,
814
- `⚠️ Unable to send heartbeat: ${ err . message } `
814
+ Emitter [ Emitter . Ping ] ,
815
+ `⚠️ Unable to send heartbeat: ${ err . message } ` ,
815
816
) ;
816
817
} ) ;
817
818
} , interval ) ;
Original file line number Diff line number Diff line change @@ -117,7 +117,10 @@ export class Queue {
117
117
await writer . write ( item . data ) ;
118
118
item . sent = true ;
119
119
} catch ( error ) {
120
- if ( error ?. code === 'ECONNRESET' || error ?. code === 'ERR_INVALID_STATE' ) {
120
+ if (
121
+ error ?. code === "ECONNRESET" ||
122
+ error ?. code === "ERR_INVALID_STATE"
123
+ ) {
121
124
writer . releaseLock ( ) ;
122
125
this . lock = false ;
123
126
throw error ;
Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ export class TransportNode implements Types.Transport {
29
29
* @param timeout - TCP socket timeout in milliseconds (defaults to 60000).
30
30
* @returns A promise that resolves with a connected TransportNode instance.
31
31
*/
32
- public static create ( hostname : string , port = 4403 , timeout = 60000 ) : Promise < TransportNode > {
32
+ public static create (
33
+ hostname : string ,
34
+ port = 4403 ,
35
+ timeout = 60000 ,
36
+ ) : Promise < TransportNode > {
33
37
return new Promise ( ( resolve , reject ) => {
34
38
const socket = new Socket ( ) ;
35
39
@@ -72,10 +76,7 @@ export class TransportNode implements Types.Transport {
72
76
if ( this . closingByUser ) {
73
77
return ; // suppress close-derived disconnect in user flow
74
78
}
75
- this . emitStatus (
76
- Types . DeviceStatusEnum . DeviceDisconnected ,
77
- "socket-end" ,
78
- ) ;
79
+ this . emitStatus ( Types . DeviceStatusEnum . DeviceDisconnected , "socket-end" ) ;
79
80
this . socket ?. removeAllListeners ( ) ;
80
81
this . socket ?. destroy ( ) ;
81
82
} ) ;
@@ -207,7 +208,7 @@ export class TransportNode implements Types.Transport {
207
208
data : { status : next , reason } ,
208
209
} ) ;
209
210
} catch ( e ) {
210
- console . error ( ' Enqueue fail' , e ) ;
211
+ console . error ( " Enqueue fail" , e ) ;
211
212
}
212
213
}
213
214
}
You can’t perform that action at this time.
0 commit comments