MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / safeSend

Function safeSend

apps/webapp/app/utils/sse.server.ts:36–60  ·  view source on GitHub ↗
(args: { event?: string; data: string })

Source from the content-addressed store, hash-verified

34
35 return eventStream(request.signal, (send, close) => {
36 const safeSend = (args: { event?: string; data: string }) => {
37 try {
38 send(args);
39 } catch (error) {
40 if (error instanceof Error) {
41 if (error.name !== "TypeError") {
42 logger.debug("Error sending SSE, aborting", {
43 error: {
44 name: error.name,
45 message: error.message,
46 stack: error.stack,
47 },
48 args,
49 });
50 }
51 } else {
52 logger.debug("Unknown error sending SSE, aborting", {
53 error,
54 args,
55 });
56 }
57
58 close();
59 }
60 };
61
62 pinger = setInterval(() => {
63 if (request.signal.aborted) {

Callers 3

sseFunction · 0.85
callMethod · 0.85
callMethod · 0.85

Calls 1

debugMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…