feat: switch from errors to fault
1 file changed, 7 insertions(+), 6 deletions(-)
changed files
M web/searchix.go → web/searchix.go
@@ -7,8 +7,9 @@ "alin.ovh/searchix/internal/config" "alin.ovh/searchix/internal/server" "alin.ovh/x/log" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" "github.com/getsentry/sentry-go" - "gitlab.com/tozd/go/errors" ) type Server struct {@@ -19,7 +20,7 @@ sentryHub *sentry.Hub options *server.Options } -func New(cfg *config.Config, log *log.Logger, options *server.Options) (*Server, errors.E) { +func New(cfg *config.Config, log *log.Logger, options *server.Options) (*Server, error) { err := sentry.Init(sentry.ClientOptions{ EnableTracing: true, TracesSampleRate: 1.0,@@ -38,16 +39,16 @@ options: options, }, nil } -func (s *Server) Start(liveReload bool) errors.E { - var err errors.E +func (s *Server) Start(liveReload bool) error { + var err error s.sv, err = server.New(s.cfg, s.options, s.log.Named("server"), liveReload) if err != nil { - return errors.Wrap(err, "error setting up server") + return fault.Wrap(err, fmsg.With("error setting up server")) } err = s.sv.Start() if err != nil { - return errors.Wrap(err, "error starting server") + return fault.Wrap(err, fmsg.With("error starting server")) } return nil