Skip to content

Commit

Permalink
fix: handle potential error message in profile registration
Browse files Browse the repository at this point in the history
Ensure that error messages are logged appropriately to aid in debugging. This change:
- Adds error.message logging with TypeScript ignore comments.
- Updates setErrorMessage to provide a default error message.
  • Loading branch information
cswni committed Nov 5, 2024
1 parent 9c0469d commit 39e577a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/loginModal/profileFormView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export const ProfileFormView: React.FC<ProfileFormProps> = ({ onSuccess, onCance
}
} catch (error) {
console.error('Error registering profile', error);
// @ts-ignore
console.error(error.message);
// @ts-ignore
setErrorMessage(error.message || 'Ocurrió un error durante el registro.');
}
},
Expand Down

0 comments on commit 39e577a

Please sign in to comment.