Package javassist

# Class CannotCompileException

java.lang.Object
java.lang.Throwable
java.lang.Exception
javassist.CannotCompileException

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `CannotReflectException`, `DuplicateMemberException`

public class CannotCompileException extends Exception
Thrown when bytecode transformation has failed.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`CannotCompileException(ClassFormatError e, String name)`
Constructs a CannotCompileException with a ClassFormatError.
`CannotCompileException(ClassNotFoundException e, String name)`
Constructs a CannotCompileException with a `ClassNotFoundException`.
`CannotCompileException(String msg)`
Constructs a CannotCompileException with a message.
`CannotCompileException(String msg, Throwable e)`
Constructs a CannotCompileException with a detailed message and an `Exception` representing the cause.
`CannotCompileException(Throwable e)`
Constructs a CannotCompileException with an `Exception` representing the cause.
`CannotCompileException(javassist.compiler.CompileError e)`
Constructs a CannotCompileException with an `CompileError`.
`CannotCompileException(NotFoundException e)`
Constructs a CannotCompileException with a `NotFoundException`.

## Method Summary

Modifier and Type
Method
Description
`Throwable`
`getCause()`
Gets the cause of this throwable.
`String`
`getReason()`
Gets a long message if it is available.
`Throwable`
`initCause(Throwable cause)`
Initializes the cause of this throwable.

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CannotCompileException

public CannotCompileException(String msg)
Constructs a CannotCompileException with a message.

Parameters:
  `msg` - the message.

### CannotCompileException

public CannotCompileException(Throwable e)
Constructs a CannotCompileException with an `Exception` representing the cause.

Parameters:
  `e` - the cause.

### CannotCompileException

public CannotCompileException(String msg, Throwable e)
Constructs a CannotCompileException with a detailed message and an `Exception` representing the cause.

Parameters:
  `msg` - the message.
  `e` - the cause.

### CannotCompileException

public CannotCompileException(NotFoundException e)
Constructs a CannotCompileException with a `NotFoundException`.

### CannotCompileException

public CannotCompileException(javassist.compiler.CompileError e)
Constructs a CannotCompileException with an `CompileError`.

### CannotCompileException

public CannotCompileException(ClassNotFoundException e, String name)
Constructs a CannotCompileException with a `ClassNotFoundException`.

### CannotCompileException

public CannotCompileException(ClassFormatError e, String name)
Constructs a CannotCompileException with a ClassFormatError.

## Method Details

### getCause

public Throwable getCause()
Gets the cause of this throwable. It is for JDK 1.3 compatibility.

Overrides:
  `getCause` in class `Throwable`

### initCause

public Throwable initCause(Throwable cause)
Initializes the cause of this throwable. It is for JDK 1.3 compatibility.

Overrides:
  `initCause` in class `Throwable`

### getReason

public String getReason()
Gets a long message if it is available.