1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-08 23:56:37 +02:00
Lee Brown 227af02f31 issue#16 web-app account signup
Account signup works with validation and translations.
2019-07-31 13:47:30 -08:00

29 lines
670 B
Go

package weberror
import "github.com/pkg/errors"
// shutdown is a type used to help with the graceful termination of the service.
type shutdown struct {
Message string
}
// Error is the implementation of the error interface.
func (s *shutdown) Error() string {
return s.Message
}
// NewShutdownError returns an error that causes the framework to signal
// a graceful shutdown.
func NewShutdownError(message string) error {
return &shutdown{message}
}
// IsShutdown checks to see if the shutdown error is contained
// in the specified error value.
func IsShutdown(err error) bool {
if _, ok := errors.Cause(err).(*shutdown); ok {
return true
}
return false
}