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

global error handling #378

Merged
merged 4 commits into from
Aug 25, 2024
Merged

global error handling #378

merged 4 commits into from
Aug 25, 2024

Conversation

joseplayero
Copy link
Collaborator

No description provided.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces global error handling for both the main Electron process and the renderer process, improving error reporting and simplifying code structure.

  • Added global error handling in /electron/main/index.ts for uncaught exceptions and unhandled rejections
  • Implemented renderer process error handling in /src/main.tsx using errorToStringRendererProcess utility
  • Removed try-catch block around ollamaService.init() in /electron/main/index.ts, potentially exposing unhandled initialization errors
  • Renamed functions for clarity: electronUtilsHandlers to registerElectronUtilsHandlers and pathHandlers to registerPathHandlers
  • Simplified error handling logic in /src/main.tsx by removing custom handleError function

4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

} catch (error) {
windowsManager.appendNewErrorToDisplayInWindow(errorToStringMainProcess(error))
}
await ollamaService.init()
Copy link

Choose a reason for hiding this comment

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

logic: Removing try-catch here may cause unhandled errors during ollamaService initialization

@joseplayero joseplayero merged commit 829e032 into main Aug 25, 2024
10 checks passed
@joseplayero joseplayero deleted the error-handling-main-process branch August 25, 2024 23:10
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.

1 participant