From 0916c382903c4d69d543f6f9892d36efc91c7525 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Thu, 24 Sep 2020 10:17:17 -0600 Subject: [PATCH] MM-28687:Handle empty returns with invalid certificates (#15564) * add error message for certificate auth issues * remove hanging '-' if not necessary * fix linter * update text, per ux review Co-authored-by: Mattermod --- i18n/en.json | 4 ++++ jobs/jobs.go | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index bb329f30eb..31cd77d09a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -5806,6 +5806,10 @@ "id": "ent.ldap.do_login.x509.app_error", "translation": "Error creating key pair" }, + { + "id": "ent.ldap.no.users.checkcertificate", + "translation": "No LDAP users found, check your user filter and certificates." + }, { "id": "ent.ldap.save_user.email_exists.ldap_app_error", "translation": "This account does not use AD/LDAP authentication. Please sign in using email and password." diff --git a/jobs/jobs.go b/jobs/jobs.go index 43cc1ce451..13f16357af 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -101,8 +101,10 @@ func (srv *JobServer) SetJobError(job *model.Job, jobError *model.AppError) *mod if job.Data == nil { job.Data = make(map[string]string) } - job.Data["error"] = jobError.Message + " — " + jobError.DetailedError - + job.Data["error"] = jobError.Message + if len(jobError.DetailedError) > 0 { + job.Data["error"] += " — " + jobError.DetailedError + } updated, err := srv.Store.Job().UpdateOptimistically(job, model.JOB_STATUS_IN_PROGRESS) if err != nil { return model.NewAppError("SetJobError", "app.job.update.app_error", nil, err.Error(), http.StatusInternalServerError)