mirror of
https://github.com/volatiletech/authboss.git
synced 2025-01-26 05:27:33 +02:00
fa6ba517db
- 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.
26 lines
627 B
Go
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)
|
|
}
|