Skip to content

Conversation

@kmichalikk
Copy link
Contributor

The error overlay that appears on UI load is shown because of Promise.reject() or throw calls, which this PR removes.

  • Promise.reject() in AuthService doesn't appear to serve any purpose so it's replaced with resolve()
  • throw error in CustomStoppingPower is called when importing stopping file configs doesn't work - it is an implementation detail not to be shown to user, but I leave a console.log() to hopefully catch it
  • throw new Error(err) in KeycloakProvider is never caught inside the component, so it is replaced with console.log()

@kmichalikk kmichalikk self-assigned this Apr 15, 2025
@kmichalikk kmichalikk linked an issue Apr 15, 2025 that may be closed by this pull request
@grzanka grzanka requested a review from Copilot April 16, 2025 08:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

src/util/keycloak/KeycloakProvider.tsx:25

  • [nitpick] Consider including detailed error information (e.g., err.message) in the log to ensure consistency with error handling in other modules.
console.log('KeycloakAuthProvider:', err);

src/services/AuthService.tsx:337

  • Replacing Promise.reject() with Promise.resolve() changes the control flow; please verify that downstream logic handles resolved promises in error cases appropriately.
return Promise.resolve();

src/ThreeEditor/Simulation/CustomStoppingPower/CustomStoppingPower.ts:33

  • [nitpick] Consider including additional context (such as error codes or stack information) in the log to aid in debugging if necessary.
console.log(`Error while loading stopping power files: ${error.message}`);

@grzanka grzanka added this pull request to the merge queue Apr 16, 2025
Merged via the queue into master with commit d70cacc Apr 16, 2025
9 checks passed
@grzanka grzanka deleted the 1824-error-overlay branch April 16, 2025 15:47
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

Successfully merging this pull request may close these issues.

Selenium tests failing locally due to React error overlay

3 participants