Skip to content

Commit 63a72ee

Browse files
authored
[chore] Improve error message specificity and show Slack icon in Node History (baserow#5313)
* Improve frontend error message specificity. * Show the Slack icon in Node History. * Scope error handling to 400 status code * Add test
1 parent deef31d commit 63a72ee

5 files changed

Lines changed: 57 additions & 2 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "refactor",
3+
"message": "Added the Slack icon to Node History entries.",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "automation",
7+
"bullet_points": [],
8+
"created_at": "2026-05-06"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "refactor",
3+
"message": "Improved the frontend error message to be more specific.",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "core",
7+
"bullet_points": [],
8+
"created_at": "2026-05-06"
9+
}

web-frontend/modules/automation/components/workflow/sidePanels/NodeHistory.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<template #header="{ expanded }">
88
<div class="node-history__header-row">
99
<div class="node-history__header-icon">
10-
<i :class="nodeIconClass"></i>
10+
<i v-if="nodeIconClass" :class="nodeIconClass"></i>
11+
<img v-else :alt="nodeType.name" :src="nodeType.image" />
1112
</div>
1213
<div class="node-history__header-info">
1314
<div>
@@ -100,7 +101,8 @@
100101

101102
<div v-else class="node-history__header-row">
102103
<div class="node-history__header-icon">
103-
<i :class="nodeIconClass"></i>
104+
<i v-if="nodeIconClass" :class="nodeIconClass"></i>
105+
<img v-else :alt="nodeType.name" :src="nodeType.image" />
104106
</div>
105107
<div class="node-history__header-info">
106108
<div

web-frontend/modules/core/plugins/clientHandler.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,20 @@ export class ErrorHandler {
278278
return this.errorMap[this.code]
279279
}
280280

281+
const status = this.response?.status || 500
282+
if (
283+
this.detail &&
284+
typeof this.detail === 'string' &&
285+
status >= 400 &&
286+
status < 500 &&
287+
this.code != 'ERROR_REQUEST_BODY_VALIDATION'
288+
) {
289+
return new ResponseErrorMessage(
290+
this.app.$i18n.t('clientHandler.notCompletedTitle'),
291+
this.detail
292+
)
293+
}
294+
281295
return this.genericDefaultError()
282296
}
283297

web-frontend/test/unit/core/utils/errors.spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ describe('test error handling', () => {
8383
}
8484
}
8585
)
86+
test('a 400 response with a string detail and no matching error map entry shows the detail as the message', async () => {
87+
try {
88+
await errorInterceptorWithStubAppAndStore()({
89+
response: {
90+
data: {
91+
error: 'noMatchingEntryInSpecificErrorMap',
92+
detail: 'The `minute` value must be greater or equal to 2.',
93+
},
94+
status: 400,
95+
},
96+
})
97+
} catch (error) {
98+
const message = error.handler.getMessage('name', {
99+
doesntMatch: new ResponseErrorMessage('title', 'message'),
100+
})
101+
expect(message.title).toBe('clientHandler.notCompletedTitle')
102+
expect(message.message).toBe(
103+
'The `minute` value must be greater or equal to 2.'
104+
)
105+
}
106+
})
86107
test('an 429 response results in a too many requests error', async () => {
87108
try {
88109
await errorInterceptorWithStubAppAndStore()({

0 commit comments

Comments
 (0)