@teamscala/service-boot 0.23.310 → 0.23.311

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.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "@teamscala/service-boot",
8
8
  "type": "module",
9
- "version": "0.23.310",
9
+ "version": "0.23.311",
10
10
  "sideEffects": false,
11
11
  "files": [
12
12
  "src"
@@ -58,6 +58,7 @@ import { getPlatformOrgId } from "@teamscala/db/registry/platform";
58
58
  import * as v from "valibot";
59
59
  import type { Prisma, WorkItem } from "./task-sync-router.ts";
60
60
  import { authed, type Context } from "./auth-router.ts";
61
+ import { getAppLogger } from "@teamscala/logger/app-loggers";
61
62
 
62
63
  /**
63
64
  * The assignment input. `name` + `description` are REQUIRED TOGETHER at the
@@ -330,16 +331,27 @@ export const createBriefTaskHandler = authed.handler(async ({ input, context })
330
331
  const ctx = context as Context;
331
332
  const prisma = ctx.prisma as Prisma;
332
333
  const data = input as v.InferOutput<typeof createBriefTaskInput>;
333
- const userId = (ctx.user as { id: string }).id;
334
- const task = await createTaskWithBriefComment(
335
- prisma,
336
- {
337
- name: data.name,
338
- description: data.description,
339
- parent_id: data.parent_id,
340
- organisation_id: resolveAssignOrg(data.organisation_id),
341
- },
342
- userId,
343
- );
344
- return { work_item_id: task.id };
334
+ try {
335
+ const userId = (ctx.user as { id: string }).id;
336
+ const task = await createTaskWithBriefComment(
337
+ prisma,
338
+ {
339
+ name: data.name,
340
+ description: data.description,
341
+ parent_id: data.parent_id,
342
+ organisation_id: resolveAssignOrg(data.organisation_id),
343
+ },
344
+ userId,
345
+ );
346
+ return { work_item_id: task.id };
347
+ } catch (err) {
348
+ // oRPC's default swallows a handler throw into a generic 500 with no stack;
349
+ // emit it so a mint failure is diagnosable, not a black box
350
+ // (a-component-may-not-report-a-state-it-has-not-verified).
351
+ getAppLogger().error("[task-sync] createBriefTask failed", {
352
+ error: err instanceof Error ? err.message : String(err),
353
+ stack: err instanceof Error ? err.stack : undefined,
354
+ });
355
+ throw err;
356
+ }
345
357
  });