Skip to main content

Error Handling

How BrowserWorker handles action errors and how to control error behavior.

Default Behavior

By default, continueOnError is true — if an action fails, the task continues executing the remaining actions. The error is logged but doesn't stop the task.

Stop on First Error

Set config.continueOnError to false to stop execution immediately when any action fails:

{
"actions": [
{ "openNewTab": "https://example.com" },
{ "click": ".must-exist-button" },
{ "screenshot": "viewport" }
],
"config": {
"continueOnError": false
}
}

If .must-exist-button is not found, the task stops and returns an error:

{
"success": false,
"error": "Element '.must-exist-button' not found within 10000ms",
"actionIndex": 1,
"action": { "click": ".must-exist-button" }
}
FieldDescription
actionIndexZero-based index of the action that failed
actionThe action object that caused the error
errorHuman-readable error message

Per-Action Override

Use options.continueOnError to override the global setting for a single action:

{
"actions": [
{ "openNewTab": "https://example.com" },
{ "click": ".optional-popup", "options": { "continueOnError": true, "timeout": 2000 } },
{ "click": "#required-button" },
{ "screenshot": "viewport" }
],
"config": {
"continueOnError": false
}
}

Here, the optional popup click can fail silently, but all other actions will stop on error.

Common Errors

ErrorCauseSolution
Element "selector" not found within XmsElement doesn't exist or hasn't loaded yetIncrease timeout, check selector, add waitForElement
Element is not a SELECT elementUsed selectOption on a non-select elementVerify the selector targets a <select>
Iframe not foundIframe selector doesn't matchCheck the iframe option selector
Task timed outWorker didn't complete within timeoutIncrease timeout, reduce actions
Worker offlineExtension disconnectedCheck that the extension is running
No workers availableAll workers busy or offlineWait and retry, or register more workers
Daily task limit reachedFree plan: 50 tasks/dayUpgrade plan or wait until tomorrow

Timeout Strategies

Increase Per-Action Timeout

For slow-loading elements:

{
"waitForElement": ".dynamic-content",
"options": { "timeout": 30000 }
}

Use waitForEvent for Dynamic Pages

{
"actions": [
{ "openNewTab": "https://spa-app.example.com" },
{ "waitForEvent": "networkIdle", "options": { "timeout": 15000 } },
{ "screenshot": "viewport" }
]
}

Give the Page Time to Load

{
"actions": [
{ "openNewTab": "https://heavy-page.example.com" },
{ "wait": 3000 },
{ "waitForElement": "#main-content" },
{ "screenshot": "viewport" }
]
}

HTTP Error Codes

CodeMeaningAction
400Invalid request (bad actions format)Fix your request JSON
401Invalid bearer tokenCheck your token in the dashboard
403Permission deniedVerify worker ownership or plan features
404No available workersWait and retry
408Task timed outIncrease timeout
409Worker busy or session mismatchTarget a different worker or wait
429Rate limit exceededUpgrade plan or wait