spur-board 0.37.0 → 0.37.1
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/dist/daemon.mjs +19 -6
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -9228,6 +9228,10 @@ async function createApiServer(options) {
|
|
|
9228
9228
|
if (error.statusCode === 400 || error.statusCode === 413) code = "usage";
|
|
9229
9229
|
if (error.statusCode === 413) hint = "Send a smaller JSON body.";
|
|
9230
9230
|
}
|
|
9231
|
+
if (code === "unexpected") options.logError?.({
|
|
9232
|
+
requestId: request.id,
|
|
9233
|
+
err: error
|
|
9234
|
+
});
|
|
9231
9235
|
const problem = renderHttpProblem({
|
|
9232
9236
|
code,
|
|
9233
9237
|
requestId: request.id
|
|
@@ -17537,9 +17541,9 @@ function createSocket(api, config, botIdentity) {
|
|
|
17537
17541
|
let stopping = false;
|
|
17538
17542
|
let connected = false;
|
|
17539
17543
|
const pending = /* @__PURE__ */ new Set();
|
|
17540
|
-
function track(work) {
|
|
17544
|
+
function track(work, kind) {
|
|
17541
17545
|
pending.add(work);
|
|
17542
|
-
work.finally(() => pending.delete(work)).catch(() => {});
|
|
17546
|
+
work.catch((err) => config.onError?.(err, kind)).finally(() => pending.delete(work)).catch(() => {});
|
|
17543
17547
|
}
|
|
17544
17548
|
function emit(event) {
|
|
17545
17549
|
if (sink === void 0) return Promise.resolve();
|
|
@@ -17607,7 +17611,7 @@ function createSocket(api, config, botIdentity) {
|
|
|
17607
17611
|
kind: "connection",
|
|
17608
17612
|
state: "up",
|
|
17609
17613
|
dedupeKey: `slack:connection:${randomUUID()}`
|
|
17610
|
-
}));
|
|
17614
|
+
}), "connection");
|
|
17611
17615
|
});
|
|
17612
17616
|
client.on("close", () => {
|
|
17613
17617
|
if (!connected || stopping) return;
|
|
@@ -17616,10 +17620,10 @@ function createSocket(api, config, botIdentity) {
|
|
|
17616
17620
|
kind: "connection",
|
|
17617
17621
|
state: "down",
|
|
17618
17622
|
dedupeKey: `slack:connection:${randomUUID()}`
|
|
17619
|
-
}));
|
|
17623
|
+
}), "connection");
|
|
17620
17624
|
});
|
|
17621
17625
|
client.on("slack_event", (envelope) => {
|
|
17622
|
-
track(handle(envelope));
|
|
17626
|
+
track(handle(envelope), "envelope");
|
|
17623
17627
|
});
|
|
17624
17628
|
try {
|
|
17625
17629
|
await client.start();
|
|
@@ -18273,6 +18277,12 @@ function createHttpModule(ctx, options = {}) {
|
|
|
18273
18277
|
status,
|
|
18274
18278
|
...tokenName === void 0 ? {} : { tokenName }
|
|
18275
18279
|
}, "http request");
|
|
18280
|
+
},
|
|
18281
|
+
logError: ({ requestId, err }) => {
|
|
18282
|
+
ctx.log.error({
|
|
18283
|
+
err,
|
|
18284
|
+
requestId
|
|
18285
|
+
}, "http request failed");
|
|
18276
18286
|
}
|
|
18277
18287
|
});
|
|
18278
18288
|
try {
|
|
@@ -18550,7 +18560,10 @@ function createDaemonModules(ctxFor, ports = {}) {
|
|
|
18550
18560
|
const settings = slackSettings(ctx.config, ctx.secrets);
|
|
18551
18561
|
const gateway = ports.gateway ?? (settings === null ? void 0 : createSlackGateway({
|
|
18552
18562
|
...settings,
|
|
18553
|
-
now: () => ctx.clock.now()
|
|
18563
|
+
now: () => ctx.clock.now(),
|
|
18564
|
+
onError: (err, work) => {
|
|
18565
|
+
ctx.log.error({ err }, work === "connection" ? "slack connection event failed" : "slack envelope failed");
|
|
18566
|
+
}
|
|
18554
18567
|
}));
|
|
18555
18568
|
const registry = createOperationRegistry({
|
|
18556
18569
|
config: board.config,
|