Function: withIpcHandler()
withIpcHandler<
T
>(channelName
:string
,handler
: () =>T
|Promise
<T
>):Promise
<IpcResponse
<T
>>
Defined in: electron/services/ipc/utils.ts:205
Wraps an IPC handler with standardized error handling, logging, and response formatting.
Type Parameters
T
T
Parameters
channelName
string
Name of the IPC channel
handler
() => T
| Promise
<T
>
The handler function to wrap
Returns
Promise
<IpcResponse
<T
>>
The wrapped handler result
Remarks
Provides consistent error handling, logging, and response formatting for all IPC handlers. Automatically logs handler execution and errors, validates parameters if provided, and ensures all responses follow the standardized format.
Example
const result = await withIpcHandler("get-sites", async () =>
this.uptimeOrchestrator.getSites()
);