use standard errors package
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
committed by
Ralf Haferkamp
parent
f7454e576a
commit
813edc4a59
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -23,7 +24,6 @@ import (
|
|||||||
"github.com/opencloud-eu/reva/v2/pkg/store"
|
"github.com/opencloud-eu/reva/v2/pkg/store"
|
||||||
"github.com/opencloud-eu/reva/v2/pkg/utils"
|
"github.com/opencloud-eu/reva/v2/pkg/utils"
|
||||||
"github.com/opencloud-eu/reva/v2/pkg/utils/ldap"
|
"github.com/opencloud-eu/reva/v2/pkg/utils/ldap"
|
||||||
"github.com/pkg/errors"
|
|
||||||
|
|
||||||
ocldap "github.com/opencloud-eu/opencloud/pkg/ldap"
|
ocldap "github.com/opencloud-eu/opencloud/pkg/ldap"
|
||||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
"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)
|
kv, err := js.KeyValue(options.Config.Store.Database)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !errors.Is(err, nats.ErrBucketNotFound) {
|
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{
|
kv, err = js.CreateKeyValue(&nats.KeyValueConfig{
|
||||||
Bucket: options.Config.Store.Database,
|
Bucket: options.Config.Store.Database,
|
||||||
})
|
})
|
||||||
if err != nil {
|
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 {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user