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

feat: detailed error handling #965

Merged
merged 17 commits into from
Apr 8, 2024
Merged

feat: detailed error handling #965

merged 17 commits into from
Apr 8, 2024

Conversation

setchy
Copy link
Member

@setchy setchy commented Apr 6, 2024

Improve error handling feedback loop by inspecting err.response and determining root cause of error.

Refactored the previous Oops view to allow error types to be passed in.

Error Type Example
Bad credentials Screenshot 2024-04-06 at 6 33 48 PM
Missing scopes Screenshot 2024-04-06 at 6 34 07 PM
Rate limited Screenshot 2024-04-06 at 6 35 31 PM
Default case (existing) Screenshot 2024-04-06 at 6 35 47 PM

@setchy setchy added the enhancement New feature or enhancement to existing functionality label Apr 6, 2024
@setchy setchy added this to the Release 5.3.0 milestone Apr 6, 2024
@setchy setchy marked this pull request as draft April 6, 2024 11:36
@setchy setchy marked this pull request as ready for review April 6, 2024 14:49
@setchy setchy marked this pull request as draft April 6, 2024 15:56
@setchy setchy marked this pull request as ready for review April 6, 2024 22:37
pnpm test -- --onlyChanged
Copy link
Collaborator

Choose a reason for hiding this comment

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

And back again? Permissions too.

Either way is fine, but probably best to keep it stable

Copy link
Member Author

@setchy setchy Apr 8, 2024

Choose a reason for hiding this comment

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

Super odd. I think I've finally got to the root of my husky dramas. NVM has been meddling with it

).data;
return response.html_url;
} catch (err) {
console.error('Failed to get html url');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Confirming this is intentionally still there?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, intentional for now.

Copy link
Member

Choose a reason for hiding this comment

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

I see 👀
You are planning on having a central place where you define all error messages aren't you? 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you guys want me to remove the try/catch from subject/helper apiRequestAuth calls?

},
};
} catch (err) {
console.error('Pull Request subject retrieval failed');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Intended?

(response as IssueComments)?.user ?? (response as ReleaseComments).author
);
} catch (err) {
console.error('Discussion latest comment retrieval failed');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto

Copy link
Collaborator

@bmulholland bmulholland left a comment

Choose a reason for hiding this comment

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

Great improvement, very user friendly. Really love this architecture, with the data structure. Clean and clear, easy to modify later. Nice work!

@setchy
Copy link
Member Author

setchy commented Apr 8, 2024

Great improvement, very user friendly. Really love this architecture, with the data structure. Clean and clear, easy to modify later. Nice work!

thanks!

I think if/when we support partial notifications (ie: one account works, one account fails) the Error page will need to morph into an Error/Warning banner. A future bridge for us to cross

@setchy
Copy link
Member Author

setchy commented Apr 8, 2024

Ended up renaming the component back to Oops since biome warned about using a global name Error (smart!)

@setchy setchy merged commit c243b0a into main Apr 8, 2024
6 of 7 checks passed
@setchy setchy deleted the feature/error-handling branch April 8, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants