Skip to content

Conversation

@klaidliadon
Copy link
Contributor

No description provided.

Comment on lines +98 to +108
ErrorsByName = map[string]*WebRPCError{
{{- range $_, $error := $webrpcErrors}}
{{ printf "%q: &Err%s," $error.Name $error.Name }}
{{- end}}
{{- if len $schemaErrors }}
{{- range $_, $error := $schemaErrors}}
{{ printf "%q: &Err%s," $error.Name $error.Name }}
{{- end}}
{{- end}}
}
ErrorsByCode = map[int]*WebRPCError{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please describe the high-level use cases for these maps?

What are you trying to achieve?

Isn't ErrorsByCode enough, why do we need ErrorsByName too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One use case is that you have custom messages you want to set, and the mapping that uses the name:message.

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.

3 participants