Skip to content

Commit 1143025

Browse files
authored
fix(3880): surface errors from query endpoint response, to the testNotification panel (#3996)
1 parent 069cb1c commit 1143025

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/flows/pipes/Notification/view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ const Notification: FC<PipeProp> = ({Context}) => {
278278

279279
setStatus(RemoteDataState.Done)
280280
dispatch(notify(testNotificationSuccess(data.endpoint)))
281-
} catch {
281+
} catch (e) {
282282
setStatus(RemoteDataState.Error)
283-
dispatch(notify(testNotificationFailure(data.endpoint)))
283+
dispatch(notify(testNotificationFailure(e.message)))
284284
}
285285
}
286286

src/shared/copy/notifications.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,10 @@ export const testNotificationSuccess = (
14671467
})
14681468

14691469
export const testNotificationFailure = (
1470-
source: 'slack' | 'pagerduty' | 'https'
1470+
reason: string = 'flux was invalid.'
14711471
): Notification => ({
14721472
...defaultErrorNotification,
1473-
message: `Failed to send the test alert to ${source}. Please try again`,
1473+
message: `Test failed: ${reason}`,
14741474
})
14751475

14761476
export const exportAlertToTaskSuccess = (

0 commit comments

Comments
 (0)