Package net.fabricmc.loom.util
Class ExceptionUtil
java.lang.Object
net.fabricmc.loom.util.ExceptionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E,C extends Throwable>
EcreateDescriptiveWrapper(BiFunction<String, C, E> constructor, String message, C cause) Creates a descriptive user-facing wrapper exception for an underlying cause.static voidprocessException(Throwable e, DaemonUtils.Context context)
-
Constructor Details
-
ExceptionUtil
public ExceptionUtil()
-
-
Method Details
-
createDescriptiveWrapper
public static <E,C extends Throwable> E createDescriptiveWrapper(BiFunction<String, C, E> constructor, String message, C cause) Creates a descriptive user-facing wrapper exception for an underlying cause.The output format has a message like this:
[message], [cause class]: [cause message]. For example:Failed to remap, java.io.IOException: Access denied.- Type Parameters:
E- the created exception typeC- the cause type- Parameters:
constructor- the exception factory which takes in a message and a causemessage- the more general message for the resulting exceptioncause- the causing exception- Returns:
- the created exception
-
processException
-