Skip to content

Commit

Permalink
Merge pull request #636 from xuwei-k/CaseClassTooLong
Browse files Browse the repository at this point in the history
deprecate `CaseClassTooLong` exception
  • Loading branch information
eed3si9n authored Oct 9, 2023
2 parents 8afcaae + 5fb2c47 commit 78efad2
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions cli/src/main/scala/scalaxb/compiler/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ object Main {
catch {
case e: ReferenceNotFound =>
log.error(e.getMessage)
case e: CaseClassTooLong =>
log.error(e.getMessage)
case e: Exception =>
log.error(e.getStackTrace.mkString("", Module.NL, Module.NL))
}
Expand Down
1 change: 1 addition & 0 deletions cli/src/main/scala/scalaxb/compiler/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ class ReferenceNotFound(kind: String, namespace: Option[String], name: String) e
"Error: Referenced " + kind + " " +
(namespace map { "{" + _ + "}" } getOrElse {"(unqualified) "}) + name + " was not found.")

@deprecated(message = "will be removed")
class CaseClassTooLong(fqn: String, xmlname: String) extends RuntimeException(
s"""Error: A case class with > 22 parameters cannot be created for ${fqn}. Consider using --wrap-contents "${xmlname}" option."""
)
3 changes: 0 additions & 3 deletions cli/src/main/scala/scalaxb/compiler/SbtApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class SbtApp extends xsbti.AppMain {
case e: ReferenceNotFound =>
logger.error(e.getMessage)
Exit(1)
case e: CaseClassTooLong =>
logger.error(e.getMessage)
Exit(1)
case e: Exception =>
logger.error(e.getStackTrace.mkString("", Module.NL, Module.NL))
Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

package scalaxb.compiler.xsd

import scalaxb.compiler.{Config, Snippet, CaseClassTooLong, Log}
import scalaxb.compiler.{Config, Snippet, Log}
import scala.collection.mutable
import scala.collection.{Map}
import scala.xml._
Expand Down
3 changes: 0 additions & 3 deletions mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

import scala.Option;
import scalaxb.compiler.Arguments;
import scalaxb.compiler.CaseClassTooLong;
import scalaxb.compiler.Module;
import scalaxb.compiler.ReferenceNotFound;

Expand Down Expand Up @@ -159,8 +158,6 @@ private void invokeCompiler(Arguments args)
context.refresh(getOutputDirectory());
} catch (ReferenceNotFound ex) {
throw new MojoFailureException(ex.getMessage(), ex);
} catch (CaseClassTooLong ex) {
throw new MojoFailureException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new MojoExecutionException("Error running scalaxb", ex);
}
Expand Down

0 comments on commit 78efad2

Please sign in to comment.