mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-18 08:26:45 +02:00
28 lines
527 B
Plaintext
28 lines
527 B
Plaintext
|
Config
|
||
|
======
|
||
|
|
||
|
set airbrake.Endpoint and airbrake.ApiKey globals
|
||
|
|
||
|
Methods
|
||
|
=======
|
||
|
|
||
|
airbrake.Error(err) reports an error
|
||
|
|
||
|
airbrake.RequestError(err, *http.Request) can be used to add more context if you are in a http context
|
||
|
|
||
|
|
||
|
You can also automatically have this library report panics, use this method:
|
||
|
|
||
|
airbrake.CapturePanic(*http.Request)
|
||
|
|
||
|
|
||
|
example:
|
||
|
|
||
|
func serve(w http.ResponseWriter, r *http.Request) {
|
||
|
defer airbrake.CapturePanic(r)
|
||
|
|
||
|
[...]
|
||
|
|
||
|
panic("Oh no :-(") // will be recorded by airbrake
|
||
|
|
||
|
}
|