Skip to content

@loontail/minecraft-kit v0.8.14 / RepairFromErrorInput

Type alias: RepairFromErrorInput

ts
type RepairFromErrorInput: {
  error: RepairableErrorLike;
  signal: AbortSignal;
  target: Target;
};

Inputs to kit.repair.fromError({ error, target }). Resume a failed install by deriving the smallest possible RepairPlan from a typed MinecraftKitError thrown by a previous kit.install.run (or any other operation that surfaces the same codes).

Example

ts
import { isMinecraftKitError } from "@loontail/minecraft-kit";

try {
  await kit.install.run(plan);
} catch (error) {
  if (isMinecraftKitError(error)) {
    const resume = await kit.repair.fromError({ error, target });
    await kit.repair.minecraft.run(resume);
  } else throw error;
}

Type declaration

MemberType
errorRepairableErrorLike
signalAbortSignal
targetTarget

Source

src/types/repair.ts:301

MIT License