mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 10:50:37 -06:00
8ee43f3705
Ref #68480 Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
19 lines
521 B
Go
19 lines
521 B
Go
package errutil
|
|
|
|
// Source identifies from where an error originates.
|
|
type Source string
|
|
|
|
const (
|
|
// SourceServer implies error originates from within the server, i.e. this application.
|
|
SourceServer Source = "server"
|
|
|
|
// SourceDownstream implies error originates from response error while server acting
|
|
// as a proxy, i.e. from a downstream service.
|
|
SourceDownstream Source = "downstream"
|
|
)
|
|
|
|
// IsDownstream checks if Source is SourceDownstream.
|
|
func (s Source) IsDownstream() bool {
|
|
return s == SourceDownstream
|
|
}
|