error responses always lower case + duplicate error response fix

This commit is contained in:
Pascal Fischer
2023-04-01 11:04:21 +02:00
parent 931c20c8fe
commit d3de035961
2 changed files with 5 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"strings"
"time"
log "github.com/sirupsen/logrus"
@ -99,7 +100,7 @@ func WriteError(err error, w http.ResponseWriter) {
httpStatus = http.StatusUnauthorized
default:
}
msg = err.Error()
msg = strings.ToLower(err.Error())
} else {
unhandledMSG := fmt.Sprintf("got unhandled error code, error: %s", err.Error())
log.Error(unhandledMSG)