1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

Add timeout error

This commit is contained in:
Asim Aslam
2018-11-25 09:41:28 +00:00
parent 77b1a25faf
commit 45c05c4e2b
2 changed files with 20 additions and 10 deletions

View File

@ -92,13 +92,13 @@ func MethodNotAllowed(id, format string, a ...interface{}) error {
}
}
// InternalServerError generates a 500 error.
func InternalServerError(id, format string, a ...interface{}) error {
// Timeout generates a 408 error.
func Timeout(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 500,
Code: 408,
Detail: fmt.Sprintf(format, a...),
Status: http.StatusText(500),
Status: http.StatusText(408),
}
}
@ -111,3 +111,13 @@ func Conflict(id, format string, a ...interface{}) error {
Status: http.StatusText(409),
}
}
// InternalServerError generates a 500 error.
func InternalServerError(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 500,
Detail: fmt.Sprintf(format, a...),
Status: http.StatusText(500),
}
}