bdy 1.25.35-stage → 1.25.36-stage
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/distTs/package.json +1 -1
- package/distTs/src/tunnel/server/sftp.js +24 -18
- package/package.json +1 -1
package/distTs/package.json
CHANGED
|
@@ -44,6 +44,12 @@ function errToStatus(err) {
|
|
|
44
44
|
return STATUS_CODE.FAILURE;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
// the error text goes along with the status code: a bare SSH_FX_FAILURE gives the user
|
|
48
|
+
// nothing to act on, while e.g. "EBUSY: resource busy or locked, open 'D:\app\x.dll'"
|
|
49
|
+
// tells them a running process holds the file
|
|
50
|
+
function errToMessage(err) {
|
|
51
|
+
return err?.message || '';
|
|
52
|
+
}
|
|
47
53
|
function sftpFlagsToPosix(flags) {
|
|
48
54
|
const read = !!(flags & SftpOpenFlag.READ);
|
|
49
55
|
const write = !!(flags & SftpOpenFlag.WRITE);
|
|
@@ -175,7 +181,7 @@ class ServerSftp {
|
|
|
175
181
|
this.debugEnd('SFTP open file succeed', s);
|
|
176
182
|
}
|
|
177
183
|
catch (err) {
|
|
178
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
184
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
179
185
|
this.debugEnd('SFTP open file failed', s, err);
|
|
180
186
|
}
|
|
181
187
|
}
|
|
@@ -206,7 +212,7 @@ class ServerSftp {
|
|
|
206
212
|
this.debugEnd('SFTP read file succeed', s);
|
|
207
213
|
}
|
|
208
214
|
catch (err) {
|
|
209
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
215
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
210
216
|
this.debugEnd('SFTP read file failed', s, err);
|
|
211
217
|
}
|
|
212
218
|
}
|
|
@@ -225,7 +231,7 @@ class ServerSftp {
|
|
|
225
231
|
this.debugEnd('SFTP write file succeed', s);
|
|
226
232
|
}
|
|
227
233
|
catch (err) {
|
|
228
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
234
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
229
235
|
this.debugEnd('SFTP write file failed', s, err);
|
|
230
236
|
}
|
|
231
237
|
}
|
|
@@ -245,7 +251,7 @@ class ServerSftp {
|
|
|
245
251
|
this.debugEnd('SFTP closed handler succeed', s);
|
|
246
252
|
}
|
|
247
253
|
catch (err) {
|
|
248
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
254
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
249
255
|
this.debugEnd('SFTP close handler failed', s, err);
|
|
250
256
|
}
|
|
251
257
|
}
|
|
@@ -274,7 +280,7 @@ class ServerSftp {
|
|
|
274
280
|
this.debugEnd('SFTP stat file succeed', s);
|
|
275
281
|
}
|
|
276
282
|
catch (err) {
|
|
277
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
283
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
278
284
|
this.debugEnd('SFTP stat file failed', s, err);
|
|
279
285
|
}
|
|
280
286
|
}
|
|
@@ -325,7 +331,7 @@ class ServerSftp {
|
|
|
325
331
|
this.debugEnd('SFTP set attrs of file succeed', s);
|
|
326
332
|
}
|
|
327
333
|
catch (err) {
|
|
328
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
334
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
329
335
|
this.debugEnd('SFTP set attrs of file failed', s, err);
|
|
330
336
|
}
|
|
331
337
|
}
|
|
@@ -342,7 +348,7 @@ class ServerSftp {
|
|
|
342
348
|
this.debugEnd('SFTP open directory succeed', s);
|
|
343
349
|
}
|
|
344
350
|
catch (err) {
|
|
345
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
351
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
346
352
|
this.debugEnd('SFTP open directory failed', s, err);
|
|
347
353
|
}
|
|
348
354
|
}
|
|
@@ -420,7 +426,7 @@ class ServerSftp {
|
|
|
420
426
|
this.debugEnd(`SFTP read directory ${fd.path} succeed`, s);
|
|
421
427
|
}
|
|
422
428
|
catch (err) {
|
|
423
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
429
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
424
430
|
this.debugEnd('SFTP read directory failed', s, err);
|
|
425
431
|
}
|
|
426
432
|
}
|
|
@@ -433,7 +439,7 @@ class ServerSftp {
|
|
|
433
439
|
this.debugEnd('SFTP stat path succeed', s);
|
|
434
440
|
}
|
|
435
441
|
catch (err) {
|
|
436
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
442
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
437
443
|
this.debugEnd('SFTP stat path failed', s, err);
|
|
438
444
|
}
|
|
439
445
|
}
|
|
@@ -446,7 +452,7 @@ class ServerSftp {
|
|
|
446
452
|
this.debugEnd('SFTP removed file succeed', s);
|
|
447
453
|
}
|
|
448
454
|
catch (err) {
|
|
449
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
455
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
450
456
|
this.debugEnd('SFTP remove file failed', s, err);
|
|
451
457
|
}
|
|
452
458
|
}
|
|
@@ -462,7 +468,7 @@ class ServerSftp {
|
|
|
462
468
|
this.debugEnd('SFTP remove directory succeed', s);
|
|
463
469
|
}
|
|
464
470
|
catch (err) {
|
|
465
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
471
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
466
472
|
this.debugEnd('SFTP remove directory failed', s, err);
|
|
467
473
|
}
|
|
468
474
|
}
|
|
@@ -484,7 +490,7 @@ class ServerSftp {
|
|
|
484
490
|
this.debugEnd('SFTP realpath succeed', s);
|
|
485
491
|
}
|
|
486
492
|
catch (err) {
|
|
487
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
493
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
488
494
|
this.debugEnd('SFTP realpath failed', s, err);
|
|
489
495
|
}
|
|
490
496
|
}
|
|
@@ -507,7 +513,7 @@ class ServerSftp {
|
|
|
507
513
|
this.debugEnd('SFTP readlink succeed', s);
|
|
508
514
|
}
|
|
509
515
|
catch (err) {
|
|
510
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
516
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
511
517
|
this.debugEnd('SFTP readlink failed', s, err);
|
|
512
518
|
}
|
|
513
519
|
}
|
|
@@ -552,7 +558,7 @@ class ServerSftp {
|
|
|
552
558
|
this.debugEnd('SFTP set attrs succeed', s);
|
|
553
559
|
}
|
|
554
560
|
catch (err) {
|
|
555
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
561
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
556
562
|
this.debugEnd('SFTP set attrs failed', s, err);
|
|
557
563
|
}
|
|
558
564
|
}
|
|
@@ -566,7 +572,7 @@ class ServerSftp {
|
|
|
566
572
|
this.debugEnd('SFTP create directory succeed', s);
|
|
567
573
|
}
|
|
568
574
|
catch (err) {
|
|
569
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
575
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
570
576
|
this.debugEnd('SFTP create directory failed', s, err);
|
|
571
577
|
}
|
|
572
578
|
}
|
|
@@ -580,7 +586,7 @@ class ServerSftp {
|
|
|
580
586
|
this.debugEnd('SFTP rename path succeed', s);
|
|
581
587
|
}
|
|
582
588
|
catch (err) {
|
|
583
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
589
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
584
590
|
this.debugEnd('SFTP rename path failed', s, err);
|
|
585
591
|
}
|
|
586
592
|
}
|
|
@@ -594,7 +600,7 @@ class ServerSftp {
|
|
|
594
600
|
this.debugEnd('SFTP symlink succeed', s);
|
|
595
601
|
}
|
|
596
602
|
catch (err) {
|
|
597
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
603
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
598
604
|
this.debugEnd('SFTP symlink failed', s, err);
|
|
599
605
|
}
|
|
600
606
|
}
|
|
@@ -607,7 +613,7 @@ class ServerSftp {
|
|
|
607
613
|
this.debugEnd('SFTP lstat path succeed', s);
|
|
608
614
|
}
|
|
609
615
|
catch (err) {
|
|
610
|
-
this.sftp.status(reqId, errToStatus(err));
|
|
616
|
+
this.sftp.status(reqId, errToStatus(err), errToMessage(err));
|
|
611
617
|
this.debugEnd('SFTP lstat path failed', s, err);
|
|
612
618
|
}
|
|
613
619
|
}
|