-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add try/catch to avoid error by pullApk in pushString #430
add try/catch to avoid error by pullApk in pushString #430
Conversation
lib/android-helpers.js
Outdated
@@ -506,7 +506,12 @@ helpers.pushStrings = async function (language, adb, opts) { | |||
// clean up remote string.json if present | |||
await adb.rimraf(remoteFile); | |||
|
|||
const app = opts.app || await adb.pullApk(opts.appPackage, opts.tmpDir); | |||
let app = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not assign app to any value by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah... fs.exists
in L511 is https://github.com/appium/appium-support/blob/42a2ab3f605d3cd3f78fe26a609c95790fbab963/lib/fs.js#L23
👍
lib/android-helpers.js
Outdated
try { | ||
app = opts.app || await adb.pullApk(opts.appPackage, opts.tmpDir); | ||
} catch (err) { | ||
logger.debug(`Failed to pull an apk from '${opts.appPackage}' to '${opts.tmpDir}'. Original error: ${err.message}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather change the level to info
@imurchie Could you take a look at this? |
@dpgraham Can you publish incrementing the version when you have time? |
Fix appium/appium#11403 (comment)
According to appium/appium#11403 (comment) ,
adb.pullApk
can raise an error.In this PR, I've added try/catch to ignore the error if
adb.pullApk
raises an error. Theapp
keeps empty in the case.I ensured this change fix the issue: appium/appium#11403 (comment)
related commit is 187c669#diff-97eeab6ebf462ba97a11ee0221ddaf13R509