mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-19 21:51:36 +00:00
Don't observe context cancellation errors.
This commit is contained in:
@@ -2,6 +2,7 @@ package git_pages
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -131,6 +132,12 @@ func FiniObservability() {
|
||||
}
|
||||
|
||||
func ObserveError(err error) {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
// Something has explicitly requested cancellation.
|
||||
// Timeout results in a different error.
|
||||
return
|
||||
}
|
||||
|
||||
if hasSentry() {
|
||||
sentry.CaptureException(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user