Skip to content

Commit 3f55b24

Browse files
Address PR #152 review feedback
- SituationRestImpl.forwardSituation: wrap body in try/catch Exception and return ALECRestUtils.somethingWentWrong(e) to preserve the structured 5xx response that the previous forwardAndStoreSituation helper provided. - SituationDetailTab.vue: drop the dangling useUserStore() call left over after the consent gate was removed (the import was already deleted, the variable was unused). Note: the shipped Karaf UI bundle under features/ui/src/main/resources/ui-ext/ still contains the removed welcome/configuration flow and needs a rebuild. That rebuild is deferred to a follow-up - pre-existing case-sensitivity bugs in the ui/ sources (axiosinstances.ts vs ./axiosInstances import, TimeLine.vue vs Timeline import) prevent yarn build from succeeding on a case-sensitive filesystem, and resolving those is out of scope for this PR. Assisted-by: Claude Code:Opus 4.7
1 parent a1658c9 commit 3f55b24

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

features/ui/src/main/java/org/opennms/alec/rest/SituationRestImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,12 @@ private boolean alarmIsNotInAnotherSituation(String reductionKey) throws Interru
248248
}
249249

250250
private Response forwardSituation(Situation oldSituation, Set<Alarm> alarms) {
251-
Situation newSituation = ImmutableSituation.newBuilderFrom(oldSituation).setAlarms(alarms).build();
252-
situationDatasource.forwardSituation(newSituation);
253-
return Response.ok().build();
251+
try {
252+
Situation newSituation = ImmutableSituation.newBuilderFrom(oldSituation).setAlarms(alarms).build();
253+
situationDatasource.forwardSituation(newSituation);
254+
return Response.ok().build();
255+
} catch (Exception e) {
256+
return ALECRestUtils.somethingWentWrong(e);
257+
}
254258
}
255259
}

ui/src/components/SituationDetailTab.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ const situationStore = useSituationsStore()
2323
2424
const REJECTED = CONST.REJECTED
2525
26-
const userStore = useUserStore()
27-
2826
const props = defineProps<{
2927
situationInfo: TSituation
3028
}>()

0 commit comments

Comments
 (0)