Skip to content

Commit

Permalink
Merge pull request #383 from snhasani/bug--unlock-archive-auth-err-msg
Browse files Browse the repository at this point in the history
Fixed #330: unlock archive dialog error message
  • Loading branch information
sallar authored Nov 6, 2017
2 parents 6e587ac + 1c13d9d commit 409fa34
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/shared/buttercup/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ export function unlockArchiveInArchiveManager(archiveId, masterPassword) {
.unlock(archiveId, masterPassword)
.then(() => archiveId)
.catch(err => {
if (err.message && err.message.includes('ENOENT')) {
throw new Error('Archive source was not found.');
const { message } = err;
if (message) {
if (message.includes('ENOENT')) {
throw new Error('Archive source was not found.');
} else if (message.includes('Authentication')) {
throw new Error('Authentication failed.');
}
throw new Error(message);
}
throw err;
});
Expand Down

0 comments on commit 409fa34

Please sign in to comment.