Skip to content

Commit c049f0e

Browse files
committed
Fixes to logging improvement
1 parent 03adfd1 commit c049f0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ldap_auth_proxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (p *LDAPAuthProxy) Authenticate(w http.ResponseWriter, r *http.Request) int
194194
err = p.LDAPClient.Connect()
195195

196196
if err != nil {
197-
traceWarning(w, err.Error())
197+
traceWarning(w, fmt.Sprintf("Failed to connect: %s", err.Error()))
198198
return http.StatusBadGateway
199199
}
200200

@@ -203,7 +203,7 @@ func (p *LDAPAuthProxy) Authenticate(w http.ResponseWriter, r *http.Request) int
203203
authenticated, attributes, err := p.LDAPClient.Authenticate(pair[0], pair[1])
204204

205205
if err != nil {
206-
traceWarning(w, fmt.Sprintf("Failed to authenticate: %d", err))
206+
traceWarning(w, fmt.Sprintf("Failed to authenticate: %s", err.Error()))
207207
return http.StatusUnauthorized
208208
}
209209

@@ -221,7 +221,7 @@ func (p *LDAPAuthProxy) Authenticate(w http.ResponseWriter, r *http.Request) int
221221
groupsOfUser, err := p.LDAPClient.GetGroupsOfUser(pair[0])
222222

223223
if err != nil {
224-
traceError(w, fmt.Sprintf("Failed to get user groups: %s", err))
224+
traceError(w, fmt.Sprintf("Failed to get user groups: %s", err.Error()))
225225
return http.StatusUnauthorized
226226
}
227227

0 commit comments

Comments
 (0)