Skip to content

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