{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/779","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/779/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/779/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/779/events","html_url":"https://github.com/webdriverio/webdriverio/pull/779","id":106055150,"number":779,"title":"Distinguish between timeout errors and other errors.","user":{"login":"jwalton","id":1771003,"avatar_url":"https://avatars.githubusercontent.com/u/1771003?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalton","html_url":"https://github.com/jwalton","followers_url":"https://api.github.com/users/jwalton/followers","following_url":"https://api.github.com/users/jwalton/following{/other_user}","gists_url":"https://api.github.com/users/jwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalton/subscriptions","organizations_url":"https://api.github.com/users/jwalton/orgs","repos_url":"https://api.github.com/users/jwalton/repos","events_url":"https://api.github.com/users/jwalton/events{/privacy}","received_events_url":"https://api.github.com/users/jwalton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-11T17:16:18Z","updated_at":"2015-09-11T17:38:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/779","html_url":"https://github.com/webdriverio/webdriverio/pull/779","diff_url":"https://github.com/webdriverio/webdriverio/pull/779.diff","patch_url":"https://github.com/webdriverio/webdriverio/pull/779.patch"},"body":"Wondering if you're interested in taking a patch along these lines - same needs to be done for other `waitFor*()` functions if you are.\r\n\r\nThe case I'm trying to address here is, if you call `waitForVisible()`, and, say, there's an alert showing, then you'll get an \"Unexpected alert open\" error when `waitForVisible()` [calls `isVisible()`](https://github.com/webdriverio/webdriverio/blob/c02ae25adfd72c5fbec2901a458bd5083c950bc1/lib/commands/waitForVisible.js#L37), but this exception gets eaten and turned into an 'element still not visible...' error, which is a little misleading.\r\n\r\nIs this a good way to fix this?  Better ideas?"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/139609466","html_url":"https://github.com/webdriverio/webdriverio/pull/779#issuecomment-139609466","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/779","id":139609466,"user":{"login":"christian-bromann","id":731337,"avatar_url":"https://avatars.githubusercontent.com/u/731337?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-bromann","html_url":"https://github.com/christian-bromann","followers_url":"https://api.github.com/users/christian-bromann/followers","following_url":"https://api.github.com/users/christian-bromann/following{/other_user}","gists_url":"https://api.github.com/users/christian-bromann/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-bromann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-bromann/subscriptions","organizations_url":"https://api.github.com/users/christian-bromann/orgs","repos_url":"https://api.github.com/users/christian-bromann/repos","events_url":"https://api.github.com/users/christian-bromann/events{/privacy}","received_events_url":"https://api.github.com/users/christian-bromann/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T17:38:50Z","updated_at":"2015-09-11T17:38:50Z","body":"@jwalton thanks for the PR!\r\n\r\nHow about we check the error message in all waitForXXX commands (e.g. [here](https://github.com/webdriverio/webdriverio/blob/master/lib/commands/waitForText.js#L49)) if it is a timeout (error message is _\"Promise never resolved with an truthy value\"_ we throw the custom error message otherwise we just throw the propagated error which would be this: \r\nhttps://github.com/webdriverio/webdriverio/blob/master/lib/commands/waitUntil.js#L95"}}