Skip to content

Commit 08a67fb

Browse files
committed
Spotbugs: overly broad catch.
1 parent c0d7166 commit 08a67fb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public FormatterFunc createFormatterFunc() {
8585
PrettierRestService restService = new PrettierRestService(prettierRestServer.getBaseUrl());
8686
String prettierConfigOptions = restService.resolveConfig(this.prettierConfig.getPrettierConfigPath(), this.prettierConfig.getOptions());
8787
return Closeable.ofDangerous(() -> endServer(restService, prettierRestServer), new PrettierFilePathPassingFormatterFunc(prettierConfigOptions, restService));
88-
} catch (Exception e) {
88+
} catch (IOException e) {
8989
throw ThrowingEx.asRuntime(e);
9090
}
9191
}

lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 DiffPlug
2+
* Copyright 2016-2021 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public FormatterFunc createFormatterFunc() {
9292
ServerProcessInfo tsfmtRestServer = npmRunServer();
9393
TsFmtRestService restService = new TsFmtRestService(tsfmtRestServer.getBaseUrl());
9494
return Closeable.ofDangerous(() -> endServer(restService, tsfmtRestServer), input -> restService.format(input, tsFmtOptions));
95-
} catch (Exception e) {
95+
} catch (IOException e) {
9696
throw ThrowingEx.asRuntime(e);
9797
}
9898
}

0 commit comments

Comments
 (0)