Skip to content

Commit f4960d1

Browse files
committed
Use MessageOnlyException instead of FeedbackProvidedException
1 parent ba33872 commit f4960d1

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

project/Build.scala

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -920,19 +920,15 @@ object Build {
920920
.start()
921921
.waitFor()
922922
if (exitCode != 0)
923-
throw new FeedbackProvidedException {
924-
override def toString = "'npm run update-all' in vscode-dotty failed"
925-
}
923+
throw new MessageOnlyException("'npm run update-all' in vscode-dotty failed")
926924
}
927925
val tsc = baseDirectory.value / "node_modules" / ".bin" / "tsc"
928926
val exitCodeTsc = new java.lang.ProcessBuilder(tsc.getAbsolutePath, "--pretty", "--project", baseDirectory.value.getAbsolutePath)
929927
.inheritIO()
930928
.start()
931929
.waitFor()
932930
if (exitCodeTsc != 0)
933-
throw new FeedbackProvidedException {
934-
override def toString = "tsc in vscode-dotty failed"
935-
}
931+
throw new MessageOnlyException("tsc in vscode-dotty failed")
936932

937933
// Currently, vscode-dotty depends on daltonjorge.scala for syntax highlighting,
938934
// this is not automatically installed when starting the extension in development mode
@@ -942,9 +938,7 @@ object Build {
942938
.start()
943939
.waitFor()
944940
if (exitCodeInstall != 0)
945-
throw new FeedbackProvidedException {
946-
override def toString = "Installing dependency daltonjorge.scala failed"
947-
}
941+
throw new MessageOnlyException("Installing dependency daltonjorge.scala failed")
948942

949943
sbt.inc.Analysis.Empty
950944
},
@@ -955,9 +949,7 @@ object Build {
955949
.start()
956950
.waitFor()
957951
if (exitCode != 0)
958-
throw new FeedbackProvidedException {
959-
override def toString = "vsce package failed"
960-
}
952+
throw new MessageOnlyException("vsce package failed")
961953

962954
baseDirectory.value / s"dotty-${version.value}.vsix"
963955
},
@@ -968,9 +960,7 @@ object Build {
968960
.start()
969961
.waitFor()
970962
if (exitCode != 0)
971-
throw new FeedbackProvidedException {
972-
override def toString = "vsce unpublish failed"
973-
}
963+
throw new MessageOnlyException("vsce unpublish failed")
974964
},
975965
publish := {
976966
val exitCode = new java.lang.ProcessBuilder("vsce", "publish")
@@ -979,9 +969,7 @@ object Build {
979969
.start()
980970
.waitFor()
981971
if (exitCode != 0)
982-
throw new FeedbackProvidedException {
983-
override def toString = "vsce publish failed"
984-
}
972+
throw new MessageOnlyException("vsce publish failed")
985973
},
986974
run := Def.inputTask {
987975
val inputArgs = spaceDelimited("<arg>").parsed
@@ -994,9 +982,7 @@ object Build {
994982
.start()
995983
.waitFor()
996984
if (exitCode != 0)
997-
throw new FeedbackProvidedException {
998-
override def toString = "Running Visual Studio Code failed"
999-
}
985+
throw new MessageOnlyException("Running Visual Studio Code failed")
1000986
}.dependsOn(compile in Compile).evaluated
1001987
)
1002988

sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ object DottyIDEPlugin extends AutoPlugin {
8282
}.unzip
8383

8484
if (dottyVersions.isEmpty)
85-
throw new FeedbackProvidedException {
86-
override def toString = "No Dotty project detected"
87-
}
85+
throw new MessageOnlyException("No Dotty project detected")
8886
else {
8987
val dottyVersion = dottyVersions.sorted.last
9088
val dottyState = updateScalaVersion(state, dottyProjRefs, dottyVersion)
@@ -212,9 +210,7 @@ object DottyIDEPlugin extends AutoPlugin {
212210
.start()
213211
.waitFor()
214212
if (exitCode != 0)
215-
throw new FeedbackProvidedException {
216-
override def toString = "Installing the Dotty support for VSCode failed"
217-
}
213+
throw new MessageOnlyException("Installing the Dotty support for VSCode failed")
218214

219215
new ProcessBuilder("code", baseDirectory.value.getAbsolutePath)
220216
.inheritIO()

0 commit comments

Comments
 (0)