Formatting
This commit is contained in:
@@ -20,7 +20,8 @@ const WS_ROUTE = '/ws';
|
||||
// Strict validation prevents legacy or protocol-specific fields reaching routes.
|
||||
const wsRequestSchema = z
|
||||
.object({
|
||||
id: z.string().min(1).optional(),
|
||||
id: z.string().min(1)
|
||||
.optional(),
|
||||
path: z.string().min(1),
|
||||
body: z.unknown().optional(),
|
||||
})
|
||||
@@ -178,13 +179,11 @@ export class WsTransportRouter implements UpgradeTransportRouter {
|
||||
* @param error - Failure to normalize into the public error shape.
|
||||
*/
|
||||
private sendError(ws: WSContext, requestId: string | undefined, error: unknown): void {
|
||||
ws.send(
|
||||
toExtendedJson({
|
||||
ws.send(toExtendedJson({
|
||||
...(requestId === undefined ? {} : { id: requestId }),
|
||||
type: 'error',
|
||||
...normalizePublicError(error),
|
||||
}),
|
||||
);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user