@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.
@@ -3148,19 +3148,33 @@ function triggerAjaxFailure(parent, beforeSendArgs, fn, result, event, operation
3148
3148
  * @private
3149
3149
  */
3150
3150
  function readSuccess(parent, result, event) {
3151
- if (!isNullOrUndefined(result.files)) {
3152
- parent.notify(event, result);
3153
- parent.notify(selectionChanged, {});
3154
- const args = { action: 'read', result: result };
3155
- parent.trigger('success', args);
3156
- }
3157
- else {
3158
- if (result.error.code === '401') {
3159
- result.files = [];
3151
+ try {
3152
+ if (!isNullOrUndefined(result.files)) {
3160
3153
  parent.notify(event, result);
3161
3154
  parent.notify(selectionChanged, {});
3155
+ const args = { action: 'read', result: result };
3156
+ parent.trigger('success', args);
3162
3157
  }
3163
- onFailure(parent, result, 'read');
3158
+ else {
3159
+ if (!isNullOrUndefined(result.error) && result.error.code === '401') {
3160
+ result.files = [];
3161
+ parent.notify(event, result);
3162
+ parent.notify(selectionChanged, {});
3163
+ }
3164
+ onFailure(parent, result, 'read');
3165
+ parent.setProperties({ path: parent.oldPath }, true);
3166
+ parent.pathNames.pop();
3167
+ }
3168
+ }
3169
+ catch (error) {
3170
+ const errorResult = {
3171
+ files: null,
3172
+ error: {
3173
+ message: error.message,
3174
+ fileExists: null
3175
+ }
3176
+ };
3177
+ onFailure(parent, errorResult, 'read');
3164
3178
  parent.setProperties({ path: parent.oldPath }, true);
3165
3179
  parent.pathNames.pop();
3166
3180
  }