diff --git a/pkg/files/files.go b/pkg/files/files.go index cea65668c..ff86ea517 100644 --- a/pkg/files/files.go +++ b/pkg/files/files.go @@ -137,7 +137,8 @@ func (f *File) Delete() (err error) { err = afs.Remove(f.getFileName()) if err != nil { - if errors.Is(err, &os.PathError{}) { + var perr *os.PathError + if errors.As(err, &perr) { // Don't fail when removing the file failed log.Errorf("Error deleting file %d: %w", err) return s.Commit() diff --git a/pkg/routes/routes.go b/pkg/routes/routes.go index f0d3c06b1..46b6c88d1 100644 --- a/pkg/routes/routes.go +++ b/pkg/routes/routes.go @@ -156,7 +156,8 @@ func NewEcho() *echo.Echo { e.HTTPErrorHandler = func(err error, c echo.Context) { // Only capture errors not already handled by echo - if errors.Is(err, &echo.HTTPError{}) { + var herr *echo.HTTPError + if errors.As(err, &herr) { hub := sentryecho.GetHubFromContext(c) if hub != nil { hub.WithScope(func(scope *sentry.Scope) {