Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java · GitHub
Open Graph Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java
X Title: can't catch `LocalException`: tried to access class com.browserstack.local.LocalException · Issue #46 · browserstack/browserstack-local-java
Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashMap
Open Graph Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashM...
X Description: Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local...
Opengraph URL: https://github.com/browserstack/browserstack-local-java/issues/46
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"can't catch `LocalException`: tried to access class com.browserstack.local.LocalException","articleBody":"Using version 1.0.3\r\n\r\nI have this Groovy code:\r\n```\r\nimport com.browserstack.local.LocalException\r\n\r\nclass AcsTestBase {\r\n...\r\n log.info 'Starting BrowserStack Local binary ...'\r\n try {\r\n bsLocal = new Local()\r\n HashMap\u003cString, String\u003e bsLocalArgs = new HashMap\u003cString, String\u003e()\r\n bsLocalArgs.put('key', key)\r\n bsLocal.start(bsLocalArgs)\r\n log.info 'bsLocal.isRunning(): ' + bsLocal.isRunning()\r\n } catch (LocalException e) {\r\n log.error e.message\r\n throw e\r\n }\r\n```\r\nThis results in this:\r\n\u003e java.lang.IllegalAccessError: tried to access class com.browserstack.local.LocalException from class tests.AcsTestBase\r\n\r\nBut if I use `catch (Exception e)` instead, then everything is working ok: I'm getting message in the log, as expected.\r\n\r\nThe point of this issue is not fact, that I'm getting Exception, but the issue is that I can't catch the exception by using `LocalException` class\r\n\r\nBy the way, the cause of exception was this (I know how to handle it):\r\n```\r\ncom.browserstack.local.LocalException: Either another browserstack local client is running on your machine or some server is listening on port 45691\r\n\tat com.browserstack.local.Local.start(Local.java:80)\r\n\tat com.browserstack.local.Local$start.call(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)\r\n...\r\n```\r\n","author":{"url":"https://github.com/SlavikCA","@type":"Person","name":"SlavikCA"},"datePublished":"2019-11-16T00:34:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/46/browserstack-local-java/issues/46"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:753263a8-3e13-58df-2f69-5444ebeacbe9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6AA:107C0:86A717:ADBAD5:69745134 |
| html-safe-nonce | 4274ac920e38daa4330696a5edbe7315e48a3f7bd0a39c99e804f9a082ed6231 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkFBOjEwN0MwOjg2QTcxNzpBREJBRDU6Njk3NDUxMzQiLCJ2aXNpdG9yX2lkIjoiNzcxNTczNDU1ODA0NDYwNjc3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 19600d395b3bc11fb0d2eab5116002532f4ee643b37e14700092136d1204365b |
| hovercard-subject-tag | issue:523760108 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/browserstack/browserstack-local-java/46/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f91bbb3460f597da1411081013e4a75cb99ee0e66db96a90487c144c7ef100b9/browserstack/browserstack-local-java/issues/46 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f91bbb3460f597da1411081013e4a75cb99ee0e66db96a90487c144c7ef100b9/browserstack/browserstack-local-java/issues/46 |
| og:image:alt | Using version 1.0.3 I have this Groovy code: import com.browserstack.local.LocalException class AcsTestBase { ... log.info 'Starting BrowserStack Local binary ...' try { bsLocal = new Local() HashM... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SlavikCA |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/browserstack/browserstack-local-java git https://github.com/browserstack/browserstack-local-java.git |
| octolytics-dimension-user_id | 1119453 |
| octolytics-dimension-user_login | browserstack |
| octolytics-dimension-repository_id | 51923142 |
| octolytics-dimension-repository_nwo | browserstack/browserstack-local-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51923142 |
| octolytics-dimension-repository_network_root_nwo | browserstack/browserstack-local-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width