fix #162: show error details on open

This commit is contained in:
Antelle 2016-03-15 22:08:08 +03:00
parent c9b58f2c9e
commit 11c6ad6ded
4 changed files with 12 additions and 0 deletions

View File

@ -145,6 +145,8 @@ var Locale = {
openPassPlaceholder: 'no password',
openConfigError: 'Error: {}',
openConfigErrorNotFound: 'File not found',
openError: 'Error',
openErrorDescription: 'There was an error opening file',
detAttDownload: 'Shift-click attachment button to download or ',
detAttDelToRemove: 'Delete to remove',

View File

@ -450,6 +450,12 @@ var OpenView = Backbone.View.extend({
this.inputEl.focus();
this.inputEl[0].selectionStart = 0;
this.inputEl[0].selectionEnd = this.inputEl.val().length;
if (err.code !== 'InvalidKey') {
Alerts.error({
header: Locale.openError,
body: Locale.openErrorDescription + '<pre class="modal__pre">' + _.escape(err.toString()) +'</pre>'
});
}
} else {
this.trigger('close');
}

View File

@ -56,4 +56,7 @@
&__check-wrap {
margin-top: $base-spacing;
}
&__pre {
white-space: pre-wrap;
}
}

View File

@ -21,6 +21,7 @@ Storage providers, usability improvements
`+` hide empty fields
`+` overall spacing increased
`+` hide demo button once opened
`+` show error details on open
`-` fix capslock indicator
`-` fix file settings input behavior
`-` fix favicon download