@syncfusion/ej2-filemanager 26.2.7 → 26.2.10

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.
@@ -3297,19 +3297,33 @@ function triggerAjaxFailure(parent, beforeSendArgs, fn, result, event, operation
3297
3297
  * @private
3298
3298
  */
3299
3299
  function readSuccess(parent, result, event) {
3300
- if (!isNullOrUndefined(result.files)) {
3301
- parent.notify(event, result);
3302
- parent.notify(selectionChanged, {});
3303
- var args = { action: 'read', result: result };
3304
- parent.trigger('success', args);
3305
- }
3306
- else {
3307
- if (result.error.code === '401') {
3308
- result.files = [];
3300
+ try {
3301
+ if (!isNullOrUndefined(result.files)) {
3309
3302
  parent.notify(event, result);
3310
3303
  parent.notify(selectionChanged, {});
3304
+ var args = { action: 'read', result: result };
3305
+ parent.trigger('success', args);
3311
3306
  }
3312
- onFailure(parent, result, 'read');
3307
+ else {
3308
+ if (!isNullOrUndefined(result.error) && result.error.code === '401') {
3309
+ result.files = [];
3310
+ parent.notify(event, result);
3311
+ parent.notify(selectionChanged, {});
3312
+ }
3313
+ onFailure(parent, result, 'read');
3314
+ parent.setProperties({ path: parent.oldPath }, true);
3315
+ parent.pathNames.pop();
3316
+ }
3317
+ }
3318
+ catch (error) {
3319
+ var errorResult = {
3320
+ files: null,
3321
+ error: {
3322
+ message: error.message,
3323
+ fileExists: null
3324
+ }
3325
+ };
3326
+ onFailure(parent, errorResult, 'read');
3313
3327
  parent.setProperties({ path: parent.oldPath }, true);
3314
3328
  parent.pathNames.pop();
3315
3329
  }