Moved error interpretation to storage provider

This commit is contained in:
Dennis Ploeger 2019-01-03 08:18:13 +01:00
parent 11b7f2a9dc
commit 363ff309e6
2 changed files with 4 additions and 1 deletions

View File

@ -63,6 +63,9 @@ const StorageFile = StorageBase.extend({
const ts = this.logger.ts();
const onError = e => {
if (e.hasOwnProperty('code') && e.code === 'EISDIR') {
e.isDir = true;
}
this.logger.error('Error writing local file', path, e);
if (callback) {
callback(e);

View File

@ -514,7 +514,7 @@ const SettingsFileView = Backbone.View.extend({
if (err) {
let title = '';
let description = '';
if (err.hasOwnProperty('code') && err.code === 'EISDIR') {
if (err.isDir) {
title = Locale.setFileBackupErrorIsDir;
description = Locale.setFileBackupErrorIsDirDescription;
} else {