| 5631 | } |
| 5632 | |
| 5633 | func (p *Server) publishError(chatID uuid.UUID, classified chaterror.ClassifiedError) { |
| 5634 | payload := chaterror.TerminalErrorPayload(classified) |
| 5635 | if payload == nil { |
| 5636 | return |
| 5637 | } |
| 5638 | p.publishEvent(chatID, codersdk.ChatStreamEvent{ |
| 5639 | Type: codersdk.ChatStreamEventTypeError, |
| 5640 | Error: payload, |
| 5641 | }) |
| 5642 | p.publishChatStreamNotify(chatID, coderdpubsub.ChatStreamNotifyMessage{ |
| 5643 | ErrorPayload: payload, |
| 5644 | Error: payload.Message, |
| 5645 | }) |
| 5646 | } |
| 5647 | |
| 5648 | func processingFailure(err error) (chaterror.ClassifiedError, bool) { |
| 5649 | if err == nil { |