Skip to content

Commit dbb1e8b

Browse files
committed
Change name of FatalRemappingException for use in Patcher
1 parent b18472b commit dbb1e8b

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

src/main/java/net/patchworkmc/manifest/accesstransformer/AccessTransformerEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.Objects;
44

55
import net.patchworkmc.manifest.accesstransformer.v2.ForgeAccessTransformer;
6-
import net.patchworkmc.manifest.accesstransformer.v2.exception.FatalRemappingException;
6+
import net.patchworkmc.manifest.accesstransformer.v2.exception.FatalMissingMappingException;
77
import net.patchworkmc.manifest.accesstransformer.v2.exception.MissingMappingException;
88
import net.patchworkmc.manifest.api.Remapper;
99

@@ -46,7 +46,7 @@ public AccessTransformerEntry remap(Remapper remapper) {
4646
this.memberName = mappedMemberName;
4747
return this;
4848
} catch (MissingMappingException ex) {
49-
throw new FatalRemappingException(ex);
49+
throw new FatalMissingMappingException(ex);
5050
}
5151
}
5252

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package net.patchworkmc.manifest.accesstransformer.v2.exception;
2+
3+
public class FatalMissingMappingException extends RuntimeException {
4+
public FatalMissingMappingException(String message, MissingMappingException parent) {
5+
super(message, parent);
6+
}
7+
8+
public FatalMissingMappingException(MissingMappingException parent) {
9+
super(parent);
10+
}
11+
12+
@Override
13+
public synchronized MissingMappingException getCause() {
14+
return (MissingMappingException) super.getCause();
15+
}
16+
17+
@Override
18+
public synchronized Throwable initCause(Throwable cause) {
19+
if (!(cause instanceof MissingMappingException)) {
20+
throw new IllegalArgumentException("Cause must be an instance of MissingMappingException!");
21+
}
22+
23+
return super.initCause(cause);
24+
}
25+
}

src/main/java/net/patchworkmc/manifest/accesstransformer/v2/exception/FatalRemappingException.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)