Skip to content

Improve error handling and optimize character lookup #112

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 1 commit into from
May 1, 2025

Conversation

codewithdhruba01
Copy link
Contributor

  • Updated error handling to prevent exposing internal error details to the client.
  • Now logs only error messages on the server for debugging purposes.
  • Sends a user-friendly error message ("An unexpected error occurred. Please try again later.") when an error happens.
  • Optimized the getCharacterByName function by replacing the loop with Array.prototype.find() for cleaner and more efficient character lookup.
  • Minor code formatting improvements for better readability.

📋 Checklist:

  • Tested the server locally
  • Verified correct error messages returned
  • Code runs without breaking existing functionality

@softchris
Copy link
Collaborator

@codewithdhruba01 thanks for the effort :)

@softchris softchris merged commit fb0f4f8 into microsoft:main May 1, 2025
2 checks passed
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants