mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
fix(http): change onboarding unavailable log level (#2048)
* fix(http): change onboarding unavailable log level * fix(http): move omitting of warning further up * feat: update log msg --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
parent
c7efcf1b75
commit
0c71f3a3d2
1 changed files with 3 additions and 2 deletions
|
@ -179,7 +179,7 @@ func (h authHandler) onboard(w http.ResponseWriter, r *http.Request) {
|
|||
func (h authHandler) canOnboard(w http.ResponseWriter, r *http.Request) {
|
||||
if status, err := h.onboardEligible(r.Context()); err != nil {
|
||||
if status == http.StatusServiceUnavailable {
|
||||
h.encoder.StatusWarning(w, status, err.Error())
|
||||
h.encoder.StatusResponse(w, status, err.Error())
|
||||
return
|
||||
}
|
||||
h.encoder.StatusError(w, status, err)
|
||||
|
@ -199,7 +199,8 @@ func (h authHandler) onboardEligible(ctx context.Context) (int, error) {
|
|||
}
|
||||
|
||||
if userCount > 0 {
|
||||
return http.StatusServiceUnavailable, errors.New("onboarding unavailable")
|
||||
h.log.Trace().Msg("onboarding unavailable: user already registered")
|
||||
return http.StatusServiceUnavailable, errors.New("onboarding unavailable: user already registered")
|
||||
}
|
||||
|
||||
return http.StatusOK, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue