Search in sources :

Example 1 with ConstraintViolationException

use of org.spongepowered.asm.util.throwables.ConstraintViolationException in project SpongeForge by SpongePowered.

the class MixinErrorHandler method getPrettyPrinter.

public PrettyPrinter getPrettyPrinter(Throwable th) {
    if (th.getCause() instanceof ConstraintViolationException) {
        ConstraintViolationException ex = (ConstraintViolationException) th.getCause();
        Constraint constraint = ex.getConstraint();
        if ("FORGE".equals(constraint.getToken())) {
            return this.forgeVersionNotValid(constraint);
        }
        return this.patchConstraintFailed(constraint, ex);
    } else if (th instanceof MixinTargetAlreadyLoadedException) {
        return this.badCoreMod((MixinTargetAlreadyLoadedException) th);
    }
    return this.itsAllGoneHorriblyWrong();
}
Also used : Constraint(org.spongepowered.asm.util.ConstraintParser.Constraint) ConstraintViolationException(org.spongepowered.asm.util.throwables.ConstraintViolationException) MixinTargetAlreadyLoadedException(org.spongepowered.asm.mixin.transformer.throwables.MixinTargetAlreadyLoadedException)

Aggregations

MixinTargetAlreadyLoadedException (org.spongepowered.asm.mixin.transformer.throwables.MixinTargetAlreadyLoadedException)1 Constraint (org.spongepowered.asm.util.ConstraintParser.Constraint)1 ConstraintViolationException (org.spongepowered.asm.util.throwables.ConstraintViolationException)1