Skip to content

Commit

Permalink
Improve error message details in checkout component
Browse files Browse the repository at this point in the history
Enhanced error handling by including specific error details from the server response when available. This change aims to provide more informative feedback to users encountering issues during the checkout process.
  • Loading branch information
Zerskk committed Dec 2, 2024
1 parent a616298 commit 4cac4e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion archigator/src/app/checkout/checkout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export class CheckoutComponent implements OnInit {
if (error.status === 403 || error.status === 422) {
console.log(`Error with status ${error.status}:`, error.message);

this.errorMessage = `Error ${error.status}: ${error.message}`;
const errDetail = error.error?.detail || 'An error occurred';

this.errorMessage = `Error ${error.status}: ${errDetail}`;

this.spinLoader = false;
}
Expand Down

0 comments on commit 4cac4e7

Please sign in to comment.