feat(daemon): Reorganize and refactor core into client/daemon/shared modules; add IPC protocol and tests
This commit is contained in:
26
ts/shared/protocol/error.codes.ts
Normal file
26
ts/shared/protocol/error.codes.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Standardized error codes for IPC communication
|
||||
* These are used instead of string messages for better error handling
|
||||
*/
|
||||
export enum ErrorCode {
|
||||
// General errors
|
||||
UNKNOWN_ERROR = 'UNKNOWN_ERROR',
|
||||
INVALID_REQUEST = 'INVALID_REQUEST',
|
||||
|
||||
// Process errors
|
||||
PROCESS_NOT_FOUND = 'PROCESS_NOT_FOUND',
|
||||
PROCESS_ALREADY_EXISTS = 'PROCESS_ALREADY_EXISTS',
|
||||
PROCESS_START_FAILED = 'PROCESS_START_FAILED',
|
||||
PROCESS_STOP_FAILED = 'PROCESS_STOP_FAILED',
|
||||
|
||||
// Daemon errors
|
||||
DAEMON_NOT_RUNNING = 'DAEMON_NOT_RUNNING',
|
||||
DAEMON_ALREADY_RUNNING = 'DAEMON_ALREADY_RUNNING',
|
||||
|
||||
// Memory errors
|
||||
MEMORY_LIMIT_EXCEEDED = 'MEMORY_LIMIT_EXCEEDED',
|
||||
|
||||
// Config errors
|
||||
CONFIG_INVALID = 'CONFIG_INVALID',
|
||||
CONFIG_SAVE_FAILED = 'CONFIG_SAVE_FAILED',
|
||||
}
|
Reference in New Issue
Block a user