Fix error messages

This commit is contained in:
Isha 2024-11-08 15:42:10 +05:30 committed by IshaVenikar
parent 88f2cc1117
commit 4d2612ed03

View File

@ -185,7 +185,7 @@ const Configure = () => {
let amount: string;
let senderAddress: string;
let txHash;
let txHash: string | null = null;
if (createFormData.option === 'LRN' && !deployer?.minimumPayment) {
toast({
id: 'no-payment-required',
@ -217,14 +217,13 @@ const Configure = () => {
);
if (!txHash) {
console.error('Tx not successful');
toast({
id: 'unsuccessful-tx',
title: 'Transaction rejected',
variant: 'error',
onDismiss: dismiss,
});
return;
throw new Error('Transaction rejected');
}
// Validate transaction hash
@ -248,6 +247,7 @@ const Configure = () => {
variant: 'error',
onDismiss: dismiss,
});
throw new Error('Transaction validation failed');
}
}
@ -290,7 +290,6 @@ const Configure = () => {
);
}
} catch (error) {
console.error(error);
toast({
id: 'error-deploying-app',
title: 'Error deploying app',
@ -378,7 +377,7 @@ const Configure = () => {
return txHash;
} catch (error) {
console.error('Error in transaction:', error);
throw new Error('Error in transaction:');
throw new Error('Error in transaction');
} finally {
setIsPaymentLoading(false);
}