Replace "errorx".First => "errors".Join
This commit is contained in:
parent
bbbd1240eb
commit
3a893bbfb6
3 changed files with 6 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
|
@ -8,7 +9,6 @@ import (
|
||||||
"github.com/FAU-CDI/wisski-distillery/internal/cli"
|
"github.com/FAU-CDI/wisski-distillery/internal/cli"
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/tkw1536/goprogram/exit"
|
"github.com/tkw1536/goprogram/exit"
|
||||||
"github.com/tkw1536/pkglib/errorx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Server is the 'server' command
|
// Server is the 'server' command
|
||||||
|
|
@ -111,5 +111,5 @@ func (s server) Run(context wisski_distillery.Context) error {
|
||||||
internalS.Shutdown(context.Context)
|
internalS.Shutdown(context.Context)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return errServerListen.Wrap(errorx.First(<-internalC, <-publicC, err))
|
return errServerListen.Wrap(errors.Join(<-internalC, <-publicC, err))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||||
"github.com/tkw1536/pkglib/errorx"
|
|
||||||
"github.com/tkw1536/pkglib/sqlx"
|
"github.com/tkw1536/pkglib/sqlx"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@ func (sql *SQL) Provision(ctx context.Context, instance models.Instance, domain
|
||||||
|
|
||||||
// Purge purges sql-specific resources for the given instance
|
// Purge purges sql-specific resources for the given instance
|
||||||
func (sql *SQL) Purge(ctx context.Context, instance models.Instance, domain string) error {
|
func (sql *SQL) Purge(ctx context.Context, instance models.Instance, domain string) error {
|
||||||
return errorx.First(
|
return errors.Join(
|
||||||
sql.PurgeDatabase(instance.SqlDatabase),
|
sql.PurgeDatabase(instance.SqlDatabase),
|
||||||
sql.PurgeUser(ctx, instance.SqlUsername),
|
sql.PurgeUser(ctx, instance.SqlUsername),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package triplestore
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
@ -10,7 +11,6 @@ import (
|
||||||
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||||
"github.com/FAU-CDI/wisski-distillery/pkg/unpack"
|
"github.com/FAU-CDI/wisski-distillery/pkg/unpack"
|
||||||
"github.com/tkw1536/goprogram/exit"
|
"github.com/tkw1536/goprogram/exit"
|
||||||
"github.com/tkw1536/pkglib/errorx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var errTripleStoreFailedRepository = exit.Error{
|
var errTripleStoreFailedRepository = exit.Error{
|
||||||
|
|
@ -26,7 +26,7 @@ func (ts *Triplestore) Provision(ctx context.Context, instance models.Instance,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts *Triplestore) Purge(ctx context.Context, instance models.Instance, domain string) error {
|
func (ts *Triplestore) Purge(ctx context.Context, instance models.Instance, domain string) error {
|
||||||
return errorx.First(
|
return errors.Join(
|
||||||
ts.PurgeRepo(ctx, instance.GraphDBRepository),
|
ts.PurgeRepo(ctx, instance.GraphDBRepository),
|
||||||
ts.PurgeUser(ctx, instance.GraphDBUsername),
|
ts.PurgeUser(ctx, instance.GraphDBUsername),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue