Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/components/Agentic/IncidentDirectives/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const IncidentDirectives = () => {
text,
ids: selectedConditions
}),
openWhenHidden: true,
onopen: (response: Response) => {
if (response.ok) {
setConversationId(
Expand Down Expand Up @@ -186,13 +187,15 @@ export const IncidentDirectives = () => {
onerror: (err: unknown) => {
abortControllerRef.current = null;
setIsStartMessageSending(false);
let errorMessage = "Unknown error starting directives chat";
if (err instanceof Error) {
// eslint-disable-next-line no-console
console.error("Error starting directives chat:", err);
} else {
// eslint-disable-next-line no-console
console.error("Unknown error starting directives chat");
errorMessage = err.message;
}

// eslint-disable-next-line no-console
console.error(errorMessage);

throw new Error(errorMessage); // Rethrow the error to avoid retrying
},
onclose: () => {
abortControllerRef.current = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const CreateIncidentChatOverlay = () => {
body: JSON.stringify({
text
}),
openWhenHidden: true,
onopen: (response: Response) => {
if (response.ok) {
setIncidentId(
Expand Down Expand Up @@ -138,13 +139,15 @@ export const CreateIncidentChatOverlay = () => {
onerror: (err: unknown) => {
abortControllerRef.current = null;
setIsStartMessageSending(false);
let errorMessage = "Unknown error starting incident creation chat";
if (err instanceof Error) {
// eslint-disable-next-line no-console
console.error("Error starting incident creation chat:", err);
} else {
// eslint-disable-next-line no-console
console.error("Unknown error starting incident creation chat");
errorMessage = err.message;
}

// eslint-disable-next-line no-console
console.error(errorMessage);

throw new Error(errorMessage); // Rethrow the error to avoid retrying
},
onclose: () => {
abortControllerRef.current = null;
Expand Down
Loading