Skip to content

Commit

Permalink
Use FeedbackProvidedException instead of AlreadyHandledException
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Jan 13, 2025
1 parent cc6f7e5 commit 4144e6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugin/src/main/scala/com/github/sbt/avro/SbtAvro.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
}
Expand All @@ -300,3 +299,7 @@ object SbtAvro extends AutoPlugin {
}

}

class AvroGenerateFailedException
extends RuntimeException("Avro generate failed")
with FeedbackProvidedException

0 comments on commit 4144e6e

Please sign in to comment.