Closed
Conversation
8e608b7 to
405f34b
Compare
Contributor
|
I'll wait with reviewing this PR until bun and sentry are completely finished. |
srieckhof
reviewed
Jan 23, 2025
Comment on lines
392
to
405
| case "array": | ||
| name, ok := data.Value.Items.Value.Properties["type"].Value.Enum[0].(string) | ||
| if !ok { | ||
| return nil, fmt.Errorf("expected as string got %T", data.Value.Items.Value.Properties["type"].Value.Enum[0]) | ||
| } | ||
|
|
||
| rel.Index().Op("*").Id(goNameHelper(name)).Tag(tags) | ||
| // case object = belongs-to | ||
| case "object": // nolint: goconst | ||
| name := data.Value.Properties["type"].Value.Enum[0].(string) | ||
| case "object": | ||
| name, ok := data.Value.Properties["type"].Value.Enum[0].(string) | ||
| if !ok { | ||
| return nil, fmt.Errorf("expected as string got %T", data.Value.Properties["type"].Value.Enum[0]) | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Can we make these two error messages distinguishable, that is, depending on the case?
| repliesJSONAPI := e.Header().Get("Content-Type") == runtime.JSONAPIContentType | ||
| requestsJSONAPI := e.req.Header.Get("Accept") == runtime.JSONAPIContentType | ||
|
|
||
| if e.statusCode >= 400 && requestsJSONAPI && !repliesJSONAPI { |
Contributor
There was a problem hiding this comment.
Should this 400 be replaced by http.BadRequest (or something like this) as well?
Comment on lines
85
to
87
| return fmt.Errorf( | ||
| "The %s member of the links object was not a string or link object", | ||
| "the %s member of the links object was not a string or link object", | ||
| k, |
Contributor
There was a problem hiding this comment.
Perhaps just on one line and use %q instead of %s.
| var tm string | ||
| if v.Kind() == reflect.String { | ||
| tm = v.Interface().(string) | ||
| tm, _ = v.Interface().(string) |
Contributor
There was a problem hiding this comment.
Did you (here and below) suppress error handling on purpose?
| ret := err | ||
| if exposedErr != nil { | ||
| ret = fmt.Errorf("%w: %s", exposedErr, err) | ||
| ret = fmt.Errorf("%w: %s", exposedErr, err.Error()) |
Contributor
There was a problem hiding this comment.
Suggested change
| ret = fmt.Errorf("%w: %s", exposedErr, err.Error()) | |
| ret = fmt.Errorf("%w: %w", exposedErr, err) |
Contributor
There was a problem hiding this comment.
There is a mixture of verbs (%s, %w) I don't really understand - already in the original. Do you know why? How about just using %w?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.