Files
orchard/internal/controller/errorresponse.go
T
Nikolay Edigaryev 357a042937 REST API: provide error messages in error responses (#66)
* REST API: provide error messages in error responses

* Fix role checking logic and add tests

* Ignore testpackage linter error

* Rename NewError() to NewErrorResponse()
2023-03-27 14:12:03 -04:00

14 lines
211 B
Go

package controller
import "fmt"
type Error struct {
Message string `json:"message"`
}
func NewErrorResponse(format string, args ...any) *Error {
return &Error{
Message: fmt.Sprintf(format, args...),
}
}