1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-26 05:27:33 +02:00
authboss/errors.go
Aaron L fa6ba517db More gigantic edits.
- Change response to be more central to Authboss. Make sure it has
  useful methods and works with the new rendering idioms.
- Change the load user methods to all work with context keys, and even
  be able to set context keys on the current request to avoid setting
  contexts everywhere in the code base.
2017-02-23 16:13:25 -08:00

26 lines
627 B
Go

package authboss
import "fmt"
// ClientDataErr represents a failure to retrieve a critical
// piece of client information such as a cookie or session value.
type ClientDataErr struct {
Name string
}
func (c ClientDataErr) Error() string {
return fmt.Sprintf("Failed to retrieve client attribute: %s", c.Name)
}
// RenderErr represents an error that occured during rendering
// of a template.
type RenderErr struct {
TemplateName string
Data interface{}
Err error
}
func (r RenderErr) Error() string {
return fmt.Sprintf("error rendering response %q: %v, data: %#v", r.TemplateName, r.Err, r.Data)
}