scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
67 lines (65 loc) • 2.84 kB
text/typescript
/**
* File manager error codes
*/
declare const FILE_MANAGER_ERROR_CODES: {
readonly NOT_FOUND: "NOT_FOUND";
readonly INVALID_PATH: "INVALID_PATH";
readonly PERMISSION_DENIED: "PERMISSION_DENIED";
readonly ACCESS_DENIED: "ACCESS_DENIED";
readonly ALREADY_EXISTS: "ALREADY_EXISTS";
readonly NOT_A_FILE: "NOT_A_FILE";
readonly NOT_A_DIRECTORY: "NOT_A_DIRECTORY";
readonly DIRECTORY_NOT_EMPTY: "DIRECTORY_NOT_EMPTY";
readonly OUTSIDE_ROOT: "OUTSIDE_ROOT";
readonly IO_ERROR: "IO_ERROR";
readonly LOCK_ERROR: "LOCK_ERROR";
readonly INVALID_OPERATION: "INVALID_OPERATION";
readonly EXTENDED_ATTRIBUTE_NOT_FOUND: "EXTENDED_ATTRIBUTE_NOT_FOUND";
readonly TAG_NOT_FOUND: "TAG_NOT_FOUND";
readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
readonly PARENT_DIRECTORY_NOT_FOUND: "PARENT_DIRECTORY_NOT_FOUND";
readonly UNKNOWN: "UNKNOWN";
};
/**
* File manager error messages
*/
declare const FILE_MANAGER_ERROR_MESSAGES: {
readonly NOT_FOUND: "File or directory not found: {path}";
readonly INVALID_PATH: "Invalid path: {path}";
readonly PERMISSION_DENIED: "Permission denied: {path}";
readonly ACCESS_DENIED: "Access denied: {path}";
readonly ALREADY_EXISTS: "File or directory already exists: {path}";
readonly NOT_A_FILE: "Path is not a file: {path}";
readonly NOT_A_DIRECTORY: "Path is not a directory: {path}";
readonly DIRECTORY_NOT_EMPTY: "Directory not empty: {path}";
readonly OUTSIDE_ROOT: "Path is outside the root directory";
readonly IO_ERROR: "IO error: {message}";
readonly LOCK_ERROR: "Lock error: {message}";
readonly INVALID_OPERATION: "Invalid operation: {message}";
readonly EXTENDED_ATTRIBUTE_NOT_FOUND: "Extended attribute not found";
readonly TAG_NOT_FOUND: "Tag not found";
readonly FILE_NOT_FOUND: "File not found";
readonly PARENT_DIRECTORY_NOT_FOUND: "Parent directory does not exist";
readonly UNKNOWN: "Unknown error";
};
/**
* File manager error class
*/
declare class FileManagerError extends Error {
code: keyof typeof FILE_MANAGER_ERROR_CODES;
path?: string;
originalError?: Error;
constructor(message: string, code: keyof typeof FILE_MANAGER_ERROR_CODES, path?: string, originalError?: Error);
toString(): string;
}
declare const ERROR_MESSAGES: {
FILE_NOT_FOUND: "File not found";
DIRECTORY_NOT_FOUND: "File or directory not found: {path}";
OUTSIDE_ROOT: "Path is outside the root directory";
INVALID_PATH: "Invalid path: {path}";
NOT_A_FILE: "Path is not a file: {path}";
NOT_A_DIRECTORY: "Path is not a directory: {path}";
ALREADY_EXISTS: "File or directory already exists: {path}";
ACCESS_DENIED: "Access denied: {path}";
};
export { ERROR_MESSAGES, FILE_MANAGER_ERROR_CODES, FILE_MANAGER_ERROR_MESSAGES, FileManagerError };