55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import type { TreeNodeType } from "./node";
|
|
|
|
export type FileSystemError =
|
|
NotADirectoryError | AlreadyExistsError | NodeNotFoundError | IllegalMutationError | FileSystemInitializationError;
|
|
|
|
export interface FileSystemInitializationError {
|
|
type: "FileSystemInitializationError";
|
|
message: string;
|
|
timestamp: number;
|
|
}
|
|
|
|
export interface NotADirectoryError {
|
|
inode: number;
|
|
message: string;
|
|
timestamp: number;
|
|
type: "NotADirectory";
|
|
nodeType: TreeNodeType;
|
|
}
|
|
|
|
export interface AlreadyExistsError {
|
|
type: "AlreadyExists";
|
|
message: string;
|
|
timestamp: number;
|
|
parentInode: number;
|
|
name: string;
|
|
}
|
|
|
|
export interface NodeNotFoundError {
|
|
type: "NodeNotFound";
|
|
message: string;
|
|
inode: number;
|
|
timestamp: number;
|
|
}
|
|
|
|
export interface DeviceNotFoundError {
|
|
type: "DeviceNotFound";
|
|
message: string;
|
|
device_id: number;
|
|
timestamp: number;
|
|
}
|
|
|
|
export interface IllegalMutationError {
|
|
type: "IllegalMutation";
|
|
message: string;
|
|
timestamp: number;
|
|
}
|
|
|
|
export interface DirectoryLoopError {
|
|
type: "DirectoryLoop";
|
|
message: string;
|
|
timestamp: number;
|
|
descendantInode: number;
|
|
ancestorInode: number;
|
|
}
|