@seam-rpc/server 4.3.13 → 4.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -120,6 +120,21 @@ export class SeamRouter {
120
120
  res.status(400).json(errorResult);
121
121
  return;
122
122
  }
123
+ if (output.ok !== true) {
124
+ seamSpace.emit("apiError", output.error, {
125
+ routerPath: path,
126
+ procedureName: req.params.procName,
127
+ input,
128
+ validatedInput,
129
+ output,
130
+ validatedOutput,
131
+ request: req,
132
+ response: res,
133
+ next,
134
+ });
135
+ res.status(400).json(output.error);
136
+ return;
137
+ }
123
138
  // Validate output
124
139
  try {
125
140
  validatedOutput = this.validateOutput(output, z.object({ ok: z.literal(true), data: procedure.output }).or(z.object({ ok: z.literal(false), error: z.any() })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seam-rpc/server",
3
- "version": "4.3.13",
3
+ "version": "4.3.14",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "bin": {