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

RFC: Fix a few pain points #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

thatguystone
Copy link
Contributor

Note: I fully expect this to be a bit controversial, but I'm introducing the issues to get some feedback.

  1. go.mod: Not sure how goji as a whole is feeling about this one.

  2. Using log.Fatal (pebkac) kills my entire server when hit. This affects all other requests. Of course, such errors should be caught in dev, but it's a bit presumptuous for a library.

  3. This applies conventional error handling rather than panic()/recover().

  4. For number errors, instead of returning the entire strconv.NumError, only return the internal error. This simplifies errors from param: error parsing key "Thing" as int: strconv.ParseInt: parsing "4.2": invalid syntax to error parsing key "Thing" as int: invalid syntax.

  5. Rename TypeError to ValueError. This might break some things, so I wanted some feedback here.

Returning the full error just adds extra noise to the error since it's
already clear that there was an error with the number. This now says
exactly what is wrong with the number.
A TypeError typically refers to the go type of something. This error is
used to indicate that the value cannot be parsed correctly.
ajmath pushed a commit to UrbanCompass/param that referenced this pull request Feb 25, 2022
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