private static String getReason(@Nullable String errorCodeString, @Nullable String message) {
    if (message == null) {
      message = "no details";
    }
    if (errorCodeString == null) {
      return "unknown: " + message;
    }

    try {
      switch (ErrorCodes.valueOf(errorCodeString)) {
        case MANIFEST_INVALID:
        case BLOB_UNKNOWN:
          return message + " (something went wrong)";

        case MANIFEST_UNKNOWN:
        case TAG_INVALID:
        case MANIFEST_UNVERIFIED:
          return message;

        default:
          return "other: " + message;
      }
    } catch (IllegalArgumentException ex) {
      return "unknown error code: " + errorCodeString + " (" + message + ")";
    }
  }
Gets the reason for certain errors.

@param errorCodeString string form of {@link ErrorCodes}
@param message the original received error message, which may or may not be used depending on
    the {@code errorCode}
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryErrorExceptionBuilder.java