mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
restore old error constants for backwards compat
Signed-off-by: R.I.Pienaar <rip@devco.net>
This commit is contained in:
@@ -33,7 +33,14 @@ var (
|
||||
ApiErrors = map[ErrorIdentifier]*ApiError{
|
||||
{{- range $i, $error := . }}
|
||||
{{ .Constant }}: {Code: {{ .Code }},ErrCode: {{ .ErrCode }},Description: {{ .Description | printf "%q" }},{{- if .Help }}Help: {{ .Help | printf "%q" }},{{- end }}{{- if .URL }}URL: {{ .URL | printf "%q" }},{{- end }} },{{- end }}
|
||||
}
|
||||
}
|
||||
|
||||
{{- range $i, $error := . }}
|
||||
{{- if .Deprecates }}
|
||||
// {{ .Deprecates }} Deprecated by {{ .Constant }} ApiError, use IsNatsError() for comparisons
|
||||
{{ .Deprecates }} = ApiErrors[{{ .Constant }}]
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
)
|
||||
`
|
||||
|
||||
@@ -52,6 +59,7 @@ type Errors struct {
|
||||
Comment string `json:"comment"`
|
||||
Help string `json:"help"`
|
||||
URL string `json:"url"`
|
||||
Deprecates string `json:"deprecates"`
|
||||
}
|
||||
|
||||
func goFmt(file string) error {
|
||||
|
||||
Reference in New Issue
Block a user