mirror of
https://github.com/containers/podman.git
synced 2025-05-25 19:16:59 +08:00
Reduce general binding binary size
when using the bindings to *only* make a connection, the binary was rough 28MB. This PR reduces it down to 11. There is more work to do but it will come in a secondary PR. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -70,3 +70,27 @@ func CloseQuiet(f *os.File) {
|
||||
func Contains(err error, sub error) bool {
|
||||
return strings.Contains(err.Error(), sub.Error())
|
||||
}
|
||||
|
||||
// ErrorModel is used in remote connections with podman
|
||||
type ErrorModel struct {
|
||||
// API root cause formatted for automated parsing
|
||||
// example: API root cause
|
||||
Because string `json:"cause"`
|
||||
// human error message, formatted for a human to read
|
||||
// example: human error message
|
||||
Message string `json:"message"`
|
||||
// http response code
|
||||
ResponseCode int `json:"response"`
|
||||
}
|
||||
|
||||
func (e ErrorModel) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
func (e ErrorModel) Cause() error {
|
||||
return errors.New(e.Because)
|
||||
}
|
||||
|
||||
func (e ErrorModel) Code() int {
|
||||
return e.ResponseCode
|
||||
}
|
||||
|
Reference in New Issue
Block a user