All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coursier.cli.launch.LaunchException.scala Maven / Gradle / Ivy

There is a newer version: 2.1.13
Show newest version
package coursier.cli.launch

import java.lang.reflect.Method

sealed abstract class LaunchException(message: String, cause: Throwable = null) extends Exception(message, cause)

object LaunchException {
  // Specify one with -M or --main.
  final class NoMainClassFound extends LaunchException("Cannot find default main class")
  final class MainClassNotFound(mainClass: String, cause: Throwable) extends LaunchException(s"Class $mainClass not found", cause)
  final class MainMethodNotFound(mainClass: Class[_], cause: Throwable) extends LaunchException(s"Main method not found in $mainClass", cause)
  final class NonStaticMainMethod(mainClass: Class[_], method: Method) extends LaunchException(s"Main method in $mainClass is not static")

  // constraint to be lifted later
  final class ClasspathHierarchyUnsupportedWhenForking extends LaunchException("Cannot start an application with a hierarchical classpath by forking")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy