Skip to content

Commit

Permalink
Merge pull request #8 from PatchworkMC/fix/various
Browse files Browse the repository at this point in the history
Change name of FatalRemappingException for use in Patcher
  • Loading branch information
TheGlitch76 authored May 19, 2020
2 parents e97e952 + dbb1e8b commit 25433a7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Objects;

import net.patchworkmc.manifest.accesstransformer.v2.ForgeAccessTransformer;
import net.patchworkmc.manifest.accesstransformer.v2.exception.FatalRemappingException;
import net.patchworkmc.manifest.accesstransformer.v2.exception.FatalMissingMappingException;
import net.patchworkmc.manifest.accesstransformer.v2.exception.MissingMappingException;
import net.patchworkmc.manifest.api.Remapper;

Expand Down Expand Up @@ -46,7 +46,7 @@ public AccessTransformerEntry remap(Remapper remapper) {
this.memberName = mappedMemberName;
return this;
} catch (MissingMappingException ex) {
throw new FatalRemappingException(ex);
throw new FatalMissingMappingException(ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.patchworkmc.manifest.accesstransformer.v2.exception;

public class FatalMissingMappingException extends RuntimeException {
public FatalMissingMappingException(String message, MissingMappingException parent) {
super(message, parent);
}

public FatalMissingMappingException(MissingMappingException parent) {
super(parent);
}

@Override
public synchronized MissingMappingException getCause() {
return (MissingMappingException) super.getCause();
}

@Override
public synchronized Throwable initCause(Throwable cause) {
if (!(cause instanceof MissingMappingException)) {
throw new IllegalArgumentException("Cause must be an instance of MissingMappingException!");
}

return super.initCause(cause);
}
}

This file was deleted.

0 comments on commit 25433a7

Please sign in to comment.