Skip to content

@loontail/minecraft-kit v0.8.14 / MinecraftKitErrorCode

Type alias: MinecraftKitErrorCode

ts
type MinecraftKitErrorCode: typeof MinecraftKitErrorCodes[keyof typeof MinecraftKitErrorCodes];

Union of every value in MinecraftKitErrorCodes. Use as the key type when building exhaustive lookup tables that translate kit codes to a consumer-facing taxonomy.

Example

ts
import { type MinecraftKitErrorCode, MinecraftKitErrorCodes } from "@loontail/minecraft-kit";

type LauncherErrorCode = "NETWORK" | "INTEGRITY" | "RUNTIME";

const KIT_TO_LAUNCHER: Partial<Record<MinecraftKitErrorCode, LauncherErrorCode>> = {
  [MinecraftKitErrorCodes.NETWORK_TIMEOUT]: "NETWORK",
  [MinecraftKitErrorCodes.NETWORK_HTTP_ERROR]: "NETWORK",
  [MinecraftKitErrorCodes.INTEGRITY_HASH_MISMATCH]: "INTEGRITY",
  [MinecraftKitErrorCodes.RUNTIME_NOT_FOUND]: "RUNTIME",
};

Source

src/types/errors.ts:72

MIT License