fix(i18n): translate backend errors at UI boundaries
This commit is contained in:
1 parent
4422ac8e01
commit
2f44d36018
82 files changed
+1862
-335
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { formatError } from "@/lib/backend/errorUtils";
|
||||
import { translateBackendError } from "@/i18n/backend-errors";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { ConsumerInfo, ProducerInfo, SubscriptionInfo, TopicInfo, TopicRef, TopicStats, MqSystemKind } from "@/types/mq";
|
||||
@@ -147,7 +148,7 @@ async function loadTopics(force = false) {
|
||||
try {
|
||||
await topicSelectRef.value?.loadTopics();
|
||||
} catch (e: unknown) {
|
||||
error.value = formatError(e);
|
||||
error.value = translateBackendError(t, formatError(e));
|
||||
} finally {
|
||||
topicsLoading.value = false;
|
||||
}
|
||||
@@ -260,7 +261,7 @@ async function loadRuntimeClients() {
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
if (isRuntimeLoadCurrent(loadSeq, currentKey)) {
|
||||
error.value = formatError(e) || String(e);
|
||||
error.value = translateBackendError(t, formatError(e)) || String(e);
|
||||
}
|
||||
} finally {
|
||||
if (loadSeq === runtimeLoadSeq) {
|
||||
|
||||
Reference in new issue
Block a user