fix: correct handling of claude response

This commit is contained in:
2025-09-28 17:16:29 +08:00
parent 3f64b70e18
commit 99a04d2a3e
4 changed files with 23 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ export const Content = () => {
try {
downloadJson(consumer, 'consumer.json');
} catch (err) {
console.error('Failed to download consumer data', err);
showToast('Failed to download consumer data');
}
};
@@ -46,6 +47,7 @@ export const Content = () => {
try {
downloadJson(purchasesResult, 'purchases.json');
} catch (err) {
console.error('Failed to download purchase history', err);
showToast('Failed to download purchase history');
}
};
@@ -69,6 +71,7 @@ export const Content = () => {
setConsumer(data.consumer);
setEditedConsumer(JSON.stringify(data.consumer, null, 2));
} catch (err) {
console.error('Something went wrong', err);
if (axios.isAxiosError(err)) {
const errorMessage = err.response?.data?.error || err.message;
showToast(errorMessage);
@@ -119,6 +122,7 @@ export const Content = () => {
setPurchasesResult(data);
} catch (err) {
console.error('Something went wrong', err);
if (axios.isAxiosError(err)) {
const errorMessage = err.response?.data?.error || err.message;
showToast(errorMessage);