Class ExceptionUtil

java.lang.Object
net.fabricmc.loom.util.ExceptionUtil

public final class ExceptionUtil extends Object
  • 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 type
      C - the cause type
      Parameters:
      constructor - the exception factory which takes in a message and a cause
      message - the more general message for the resulting exception
      cause - the causing exception
      Returns:
      the created exception
    • processException

      public static void processException(Throwable e, DaemonUtils.Context context)