Skip to content

Commit

Permalink
handled errorif status is 200
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-shivamsingh committed Oct 23, 2023
1 parent 17dbefa commit 185d779
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/webdriver-utils/src/providers/automateProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default class AutomateProvider extends GenericProvider {
state: 'begin'
});
// Selenium Hub, set status error Code to 13 if an error is thrown
if (result?.status !== 200) throw new Error(result)
if (result?.status !== 200) throw new Error(result?.value || 'Got invalid error response')
this._markedPercy = result.success;
return result;
} catch (e) {
Expand All @@ -99,7 +99,6 @@ export default class AutomateProvider extends GenericProvider {
*/
const errResponse = e?.response?.body && JSON.parse(e?.response?.body)?.value || {}
const errMessage = errResponse?.message || errResponse?.error || e?.message || e?.error || e?.value || e.toString()

throw new Error(errMessage)
}
});
Expand Down

0 comments on commit 185d779

Please sign in to comment.