Skip to content
New issue

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

By clicking “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? Sign in to your account

refactor: FindROund6Data #50

Open
wit03 opened this issue Oct 9, 2024 · 0 comments
Open

refactor: FindROund6Data #50

wit03 opened this issue Oct 9, 2024 · 0 comments

Comments

@wit03
Copy link
Member

wit03 commented Oct 9, 2024

Wit's comment:
Is it really necessary at all?

Consider adding error handling to FindRound6Data function

While the function logic is correct, it lacks error handling for potential issues that may occur during data fetching or processing.

Consider wrapping the function body in a try-catch block:

async function FindRound6Data(
  decodedString: string
): Promise<iRetroPGF6Project | undefined> {
  try {
    const data = await getRealTimeRetroPGF6()
    return data.find((elem) => cleanParamsName(elem.name) === decodedString)
  } catch (error) {
    console.error('Error fetching or processing RetroPGF6 data:', error)
    throw error // Re-throw to be handled by the caller
  }
}

This change will improve error handling and allow the caller to decide how to handle any errors that occur.

Originally posted by @coderabbitai[bot] in #46 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant