From 4144e6eb3b80cd88cf5f95c8439b233700c2b240 Mon Sep 17 00:00:00 2001 From: Michel Davit Date: Mon, 13 Jan 2025 09:40:32 +0100 Subject: [PATCH] Use FeedbackProvidedException instead of AlreadyHandledException --- plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala b/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala index 489d082..f8bbe2e 100644 --- a/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala +++ b/plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala @@ -1,7 +1,7 @@ package com.github.sbt.avro import sbt.Keys.* -import sbt.{*, given} +import sbt.{*, given, FeedbackProvidedException} import Path.relativeTo import PluginCompat.* import sbt.librarymanagement.DependencyFilter @@ -283,8 +283,7 @@ object SbtAvro extends AutoPlugin { } catch { case e: Exception => out.log.err(e.getMessage) - // avoid stacktrace in sbt - throw new AlreadyHandledException(e) + throw new AvroGenerateFailedException } finally { avroClassLoader.close() } @@ -300,3 +299,7 @@ object SbtAvro extends AutoPlugin { } } + +class AvroGenerateFailedException + extends RuntimeException("Avro generate failed") + with FeedbackProvidedException