mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2025-07-05 23:52:30 +00:00
20 lines
272 B
Go
20 lines
272 B
Go
package types
|
|
|
|
import "fmt"
|
|
|
|
type APIError struct {
|
|
Code int
|
|
Message string
|
|
}
|
|
|
|
func ErrorFromMeta(meta Meta) APIError {
|
|
return APIError{
|
|
meta.Statuscode,
|
|
meta.Message,
|
|
}
|
|
}
|
|
|
|
func (e *APIError) Error() string {
|
|
return fmt.Sprintf("%d : %s", e.Code, e.Message)
|
|
}
|