mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 12:01:15 +02:00
* REST API: provide error messages in error responses * Fix role checking logic and add tests * Ignore testpackage linter error * Rename NewError() to NewErrorResponse()
14 lines
211 B
Go
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...),
|
|
}
|
|
}
|