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

chore: HTTP server error handling #1494

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

iuricmp
Copy link
Contributor

@iuricmp iuricmp commented Jan 2, 2024

This PR adds a simple error handler for gnofaucet server.

We currently have NO feedback on any failure in the gnofaucet HTTP server, which makes troubleshooting more difficult.

Imagine the scenario where the port 5050 is already busy!

To test:
1 - run gnofaucet in a terminal.
2 - try to run another instance of gnofaucet in a different terminal.
3 - a clear error message is expected on step n2.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@iuricmp iuricmp requested a review from a team as a code owner January 2, 2024 23:12
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jan 2, 2024
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c3a4993) 55.85% compared to head (da82cdb) 56.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1494      +/-   ##
==========================================
+ Coverage   55.85%   56.09%   +0.23%     
==========================================
  Files         431      432       +1     
  Lines       65729    65971     +242     
==========================================
+ Hits        36713    37005     +292     
+ Misses      26140    26071      -69     
- Partials     2876     2895      +19     
Flag Coverage Δ
go-1.21.x ∅ <ø> (∅)
misc ∅ <ø> (∅)
misc-_test.genstd ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Iuri Pereira <iuricmp@gmail.com>
@iuricmp iuricmp force-pushed the chore/gnofaucet-catch-server-error branch from 108c5df to da82cdb Compare January 2, 2024 23:15
Copy link
Member

@gfanton gfanton left a comment

Choose a reason for hiding this comment

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

lgtm, maybe we should take this opportunity to add custom listening flag to the faucet

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

approving & merging these changes as they improve on the current situation; but, judging from discussions on Gno-Core-Contribs, even if not removing gnofaucet, we're likely to be deprecating it in favour of the new faucet.

if you have other features which would aid you for gnofaucet, please make a PR, though I would advise you to work with integrating the new faucet instead.

@thehowl thehowl merged commit 262d0cd into gnolang:master Jan 7, 2024
182 checks passed
gfanton pushed a commit to moul/gno that referenced this pull request Jan 18, 2024
This PR adds a simple error handler for gnofaucet server.

We currently have NO feedback on any failure in the gnofaucet HTTP
server, which makes troubleshooting more difficult.

Imagine the scenario where the port 5050 is already busy!

To test:
1 - run gnofaucet in a terminal.
2 - try to run another instance of gnofaucet in a different terminal.
3 - a clear error message is expected on step n2.


<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

Signed-off-by: Iuri Pereira <iuricmp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Status: No status
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants