Skip to content

Commit 4be3ae6

Browse files
committed
(fix): Warnings error should not show on HTTP 204 - case is expected
1 parent 36cfc43 commit 4be3ae6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

frontend/js/compare.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ const fetchWarningsForRuns = async (ids) => {
2525
const data = await makeAPICall('/v1/warnings/' + id);
2626
if (data?.data) warnings.push(...data.data);
2727
} catch (err) {
28-
showNotification('Could not get warnings data from API', err);
28+
if (err instanceof APIEmptyResponse204) {
29+
console.log('No warnings where present in API response. Skipping error as this is allowed case.')
30+
} else {
31+
showNotification('Could not get warnings data from API', err);
32+
}
2933
}
3034
}
3135
return warnings;

frontend/js/stats.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,13 @@ const fetchAndFillWarnings = async (url_params) => {
593593
warnings = await makeAPICall('/v1/warnings/' + url_params['id'])
594594
if (!warnings || warnings?.data?.length === 0) return;
595595
} catch (err) {
596-
showNotification('Could not get warnings data from API', err);
596+
if (err instanceof APIEmptyResponse204) {
597+
console.log('No warnings where present in API response. Skipping error as this is allowed case.')
598+
} else {
599+
showNotification('Could not get warnings data from API', err);
600+
}
597601
return;
602+
598603
}
599604

600605
const container = document.querySelector('#run-warnings');

0 commit comments

Comments
 (0)