diff --git a/lib/basedriver/helpers.js b/lib/basedriver/helpers.js index 99662fbbe..5a51140a3 100644 --- a/lib/basedriver/helpers.js +++ b/lib/basedriver/helpers.js @@ -279,8 +279,13 @@ async function configureApp (app, supportedAppExtensions) { if (archivePath !== app) { await fs.rimraf(archivePath); } - logger.info(`Will reuse previously cached application at '${fullPath}'`); - return verifyAppExtension(fullPath, supportedAppExtensions); + logger.info(`Will try to reuse previously cached application at '${fullPath}'`); + try { + return verifyAppExtension(fullPath, supportedAppExtensions); + } catch (err) { + logger.warn(`Cached applicattion '${fullPath}' does not have ${util.pluralize('extension', supportedAppExtensions.length, false)} '${supportedAppExtensions}', will look for app in archive '${archivePath}'`); + return archivePath; + } } logger.info(`The application at '${fullPath}' does not exist anymore ` + `or its integrity has been damaged. Deleting it from the cache`);