use standard errors package

Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
Christian Richter
2025-09-23 15:46:59 +02:00
committed by Ralf Haferkamp
parent f7454e576a
commit 813edc4a59

View File

@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"net/http"
"os"
@@ -23,7 +24,6 @@ import (
"github.com/opencloud-eu/reva/v2/pkg/store"
"github.com/opencloud-eu/reva/v2/pkg/utils"
"github.com/opencloud-eu/reva/v2/pkg/utils/ldap"
"github.com/pkg/errors"
ocldap "github.com/opencloud-eu/opencloud/pkg/ldap"
"github.com/opencloud-eu/opencloud/pkg/log"
@@ -171,14 +171,15 @@ func NewService(opts ...Option) (Graph, error) { //nolint:maintidx
kv, err := js.KeyValue(options.Config.Store.Database)
if err != nil {
if !errors.Is(err, nats.ErrBucketNotFound) {
return Graph{}, errors.Wrapf(err, "Failed to get bucket (%s)", options.Config.Store.Database)
return Graph{}, fmt.Errorf("Failed to get bucket (%s): %w", options.Config.Store.Database, err)
}
kv, err = js.CreateKeyValue(&nats.KeyValueConfig{
Bucket: options.Config.Store.Database,
})
if err != nil {
return Graph{}, errors.Wrapf(err, "Failed to create bucket (%s)", options.Config.Store.Database)
return Graph{}, fmt.Errorf("Failed to create bucket (%s): %w", options.Config.Store.Database, err)
}
}
if err != nil {