Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScalafmtDynamic: throw once if can't resolve config #2065

Merged
merged 3 commits into from
Jul 5, 2020

Conversation

kitbellew
Copy link
Collaborator

Intellij invokes the createSession method directly and doesn't expect the null value we return there, so throw ConfigError instead.

Similarly, in the Runner, change the implementation of MyInstanceSession to verify the config first, so that the config parsing exception is not thrown for every file we are trying to format.

kitbellew added 2 commits July 4, 2020 09:21
Remove ScalafmtConfigException and instead change ScalafmtDynamicError
to derive from Error, group errors indicating a permanent problem with
the config as the ConfigError subtype.
The reflected exception type can't be used directly, so wrap it in the
ConfigParseError.
Intellij invokes the createSession method directly and doesn't expect
the null value we return there, so throw ConfigError instead.

Similarly, in the Runner, change the implementation of MyInstanceSession
to verify the config first, so that the config parsing exception is not
thrown for every file we are trying to format.
@kitbellew kitbellew merged commit a7bb692 into scalameta:master Jul 5, 2020
@kitbellew kitbellew deleted the 2065 branch July 5, 2020 10:14
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.

2 participants