MCPcopy Index your code
hub / github.com/codeaashu/claude-code / addErrorNotificationIfNeeded

Function addErrorNotificationIfNeeded

src/services/compact/compact.ts:1108–1123  ·  view source on GitHub ↗
(
  error: unknown,
  context: Pick<ToolUseContext, 'addNotification'>,
)

Source from the content-addressed store, hash-verified

1106}
1107
1108function addErrorNotificationIfNeeded(
1109 error: unknown,
1110 context: Pick<ToolUseContext, 'addNotification'>,
1111) {
1112 if (
1113 !hasExactErrorMessage(error, ERROR_MESSAGE_USER_ABORT) &&
1114 !hasExactErrorMessage(error, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES)
1115 ) {
1116 context.addNotification?.({
1117 key: 'error-compacting-conversation',
1118 text: 'Error compacting conversation',
1119 priority: 'immediate',
1120 color: 'error',
1121 })
1122 }
1123}
1124
1125export function createCompactCanUseTool(): CanUseToolFn {
1126 return async () => ({

Callers 2

compactConversationFunction · 0.85

Calls 1

hasExactErrorMessageFunction · 0.85

Tested by

no test coverage detected