ErrorForSession creates an error event tagged with the session ID that produced it. Use this inside the runtime run loop where sess.ID is available so that isRootEvent can distinguish root-session errors from child-session errors forwarded by runForwarding.
(sessionID, msg string)
| 276 | // available so that isRootEvent can distinguish root-session errors from |
| 277 | // child-session errors forwarded by runForwarding. |
| 278 | func ErrorForSession(sessionID, msg string) Event { |
| 279 | return &ErrorEvent{ |
| 280 | Type: "error", |
| 281 | SessionID: sessionID, |
| 282 | Error: msg, |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | // ErrorWithCodeForSession creates an error event with a code and session ID. |
| 287 | // See ErrorForSession for the session-tagging rationale. |