fix: correct handling of claude response
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user