8000 catch exceptions instead of letting them hard fail builds by Strum355 · Pull Request #55 · sourcegraph/scip-kotlin · GitHub
[go: up one dir, main page]

Skip to content

catch exceptions instead of letting them hard fail builds#55

Merged
Strum355 merged 2 commits intomainfrom
nsc/analyzer-exception-catch
Apr 19, 2023
Merged

catch exceptions instead of letting them hard fail builds#55
Strum355 merged 2 commits intomainfrom
nsc/analyzer-exception-catch

Conversation

@Strum355
Copy link
Contributor
@Strum355 Strum355 commented Apr 17, 2023

Having issues with getting the exceptions logged (in any way, even directly with stderr), have asked in official slack about it Have implemented a workaround that also involves a change in scip-java, PR here: sourcegraph/scip-java#551

Test plan

Added unit test and ran E2E via sbt-invoked scip-java

@Strum355 Strum355 requested review from keynmol and olafurpg April 17, 2023 19:07
@Strum355 Strum355 self-assigned this Apr 17, 2023
return super.analysisCompleted(project, module, bindingTrace, files)
}
super.analysisCompleted(project, module, bindingTrace, files)
} catch (e: Exception) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Kotlin have something similar to Scala's NonFatal handler?

https://sourcegraph.com/github.com/scala/scala/-/blob/src/library/scala/util/control/NonFatal.scala?L42

You typically don't want to catch Exception since it swallows fatal exceptions like OOM or VM failures that should propagate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOM and other *Error throwables arent a subclass of Exception, so they wouldnt be caught by this, theyre subclasses of Error. NonFatal in Scala deals with throwables, the supertype of error and exception

@Strum355 Strum355 changed the title wip: catch exceptions instead of letting them hard fail builds catch exceptions instead of letting them hard fail builds Apr 18, 2023
@Strum355 Strum355 requested a review from olafurpg April 18, 2023 20:06
@Strum355 Strum355 merged commit aa72546 into main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0