package route

import "errors"

// BadRequestError indicates the incoming request is syntactically invalid (e.g., bad port).
type BadRequestError struct {
	msg string
}

func (e BadRequestError) Error() string {
	return e.msg
}

// IsBadRequest reports whether err is caused by bad client input.
func IsBadRequest(err error) bool {
	var br BadRequestError
	return errors.As(err, &br)
}
