forked from bitcoin-sv/dpp-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.go
More file actions
25 lines (20 loc) · 797 Bytes
/
server.go
File metadata and controls
25 lines (20 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Package server is needed for swagger doc generation. Do not delete.
package server
import (
"fmt"
validator "github.com/theflyingcodr/govalidator"
)
// ClientError defines an error type that can be returned to handle client errors.
type ClientError struct {
ID string `json:"id" example:"e97970bf-2a88-4bc8-90e6-2f597a80b93d"`
Code string `json:"code" example:"N01"`
Title string `json:"title" example:"not found"`
Message string `json:"message" example:"unable to find foo when loading bar"`
}
func (c ClientError) Error() string {
return fmt.Sprintf("%s: %s", c.Title, c.Message)
}
// BadRequestError defines an error type to handle validation errors.
type BadRequestError struct {
Errors validator.ErrValidation `json:"errors" swaggertype:"validator.ErrValidation"`
}