mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Contribute: Add error source section to errors documentation (#75462)
This commit is contained in:
parent
1867fc5cee
commit
896b12d422
@ -105,6 +105,18 @@ unfortunately not readily available on pkg.go.dev because Grafana is not
|
|||||||
fully Go modules compatible, but can be viewed using
|
fully Go modules compatible, but can be viewed using
|
||||||
[godoc](https://go.dev/cmd/godoc/) from the Grafana directory.
|
[godoc](https://go.dev/cmd/godoc/) from the Grafana directory.
|
||||||
|
|
||||||
|
### Error source
|
||||||
|
|
||||||
|
You can optionally specify an error source that describes from where an
|
||||||
|
error originates. By default it's _server_ and means the error originates
|
||||||
|
from within the application, e.g. Grafana. The `errutil.WithDownstream()`
|
||||||
|
option may be appended to the NewBase function call to denote an error
|
||||||
|
originates from a _downstream_ server/service. The error source information
|
||||||
|
is used in the API layer to distinguish between Grafana errors and
|
||||||
|
non-Grafana errors to include this information when instrumenting the
|
||||||
|
application and by that allowing Grafana operators to define SLO's
|
||||||
|
based on actual Grafana errors.
|
||||||
|
|
||||||
### Handling errors in the API
|
### Handling errors in the API
|
||||||
|
|
||||||
API handlers use the `github.com/grafana/grafana/pkg/api/response.Err`
|
API handlers use the `github.com/grafana/grafana/pkg/api/response.Err`
|
||||||
|
Loading…
Reference in New Issue
Block a user