Skip to content

Commit 8fdabe9

Browse files
committed
Improve error message clarity in ApiResponse component and format invalid metrics output
1 parent 8cee938 commit 8fdabe9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/ApiResponse.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ export default defineComponent({
109109
this.message = 'All metrics are valid!';
110110
this.isError = false;
111111
} else {
112-
this.message = 'Some metrics are invalid!\n';
112+
this.message = 'Some metrics maybe are invalid, pls double check!\n';
113113
this.isError = true;
114+
let typeCounter = 1;
114115
for (const [key, value] of Object.entries(results)) {
115116
if (value.length > 0) {
116-
this.message += `${key}: ${JSON.stringify(value, null, 2)}\n`;
117+
this.message += `\n${typeCounter}). ${key}:\n${JSON.stringify(value, null, 2)}\n`;
118+
typeCounter++;
117119
}
118120
}
119121
}

0 commit comments

Comments
 (0)