mirror of
https://github.com/Luzifer/staticmap.git
synced 2024-12-21 05:11:18 +00:00
15 lines
370 B
Go
15 lines
370 B
Go
// Package errors provide data structure for errors.
|
|
package errors
|
|
|
|
import "fmt"
|
|
|
|
// HTTPError is an error struct that returns both message and status code.
|
|
type HTTPError struct {
|
|
Message string
|
|
StatusCode int
|
|
}
|
|
|
|
// Error returns error message.
|
|
func (httperror *HTTPError) Error() string {
|
|
return fmt.Sprintf("%v: %v", httperror.StatusCode, httperror.Message)
|
|
}
|