Fix error message not showing when an unsupported image is selected

Changelog-entry: Fix error message not showing when an unsupported image is selected
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2019-02-27 16:06:59 +01:00
parent 6b6a0d7b4f
commit f0374cf9d9

View File

@ -175,18 +175,17 @@ module.exports = function (
$timeout()
})
})
.catch((error) => {
const imageError = errors.createUserError({
title: 'Error opening image',
description: messages.error.openImage(path.basename(imagePath), error.message)
})
osDialog.showError(imageError)
analytics.logException(error)
})
.then(() => {
return innerSource.close()
.catch(_.noop)
})
})
.catch((error) => {
const imageError = errors.createUserError({
title: 'Error opening image',
description: messages.error.openImage(path.basename(imagePath), error.message)
})
osDialog.showError(imageError)
analytics.logException(error)
})
.finally(() => {
return source.close().catch(_.noop)
})
}