// Boomify creates a boom error starting with its status code
Boomify creates a boom error starting with its status code
// Boomify creates a boom error starting with its status code
func Boomify(statusCode int, args ...interface{}) Err {
	errorType := http.StatusText(statusCode)
	message := errorType 
	var data *map[string]string
	if l := len(args); l != 0 {
		for _, arg := range args {
			switch converted := arg.(type) {
			case string:
				message = converted
			case error:
				message = converted.Error()
			case map[string]string:
				data = &converted
			}
		}
	}
	return Err{
		errorType,
		message,
		statusCode,
		data,
	}
}
func Boomify ( statusCode int , args ... interface { } ) Err { errorType := http . StatusText ( statusCode ) message := errorType var data * map [ string ] string if l := len ( args ) ; l != 0 { for _ , arg := range args { switch converted := arg . ( type ) { case string : message = converted case error : message = converted . Error ( ) case map [ string ] string : data = & converted } } } return Err { errorType , message , statusCode , data , } }
Boomify creates a boom error starting with its status code
Boomify creates a boom error starting with its status code
// should be same as errorType by default // determine if an error or string arg was passed in // set the message accordingly