Skip to content

Robust Error handling + security audit#3

Merged
dylmanning merged 1 commit into
testfrom
errorHandling
May 14, 2025
Merged

Robust Error handling + security audit#3
dylmanning merged 1 commit into
testfrom
errorHandling

Conversation

@JoseMiguelHerrera
Copy link
Copy Markdown
Member

refactor some things and also add robust error handling, specially in…the fatal error scenario

@JoseMiguelHerrera JoseMiguelHerrera requested a review from 4nche May 9, 2025 02:45
Comment thread database/index.ts
TokenMigration[]
> {
if (!db) {
throw new Error("Database not initialized");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

instead of erroring, maybe try to initialize the database again?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I looked into it, and it could be done, but I don't think it's worth it. After all the db gets initialized as the 2nd thing in main(). These errors shouldn't happen, I added them more to appease Typescript. The connection to the DB certainly could be dropped, which would give an error, but the db object will never be null after the initialization.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@4nche if you agree, can you merge this so dylan can deploy it?

@dylmanning dylmanning merged commit 21994ea into test May 14, 2025
2 checks passed
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.

3 participants