diff --git a/web/kanban.js b/web/kanban.js index b2f6f11..db4d07d 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -940,7 +940,13 @@ function formDialog(title,{text,fields=[],label='Salvar',tone='pri',host,width,n const form=m.box;if(className)form.classList.add(className); cancel.onclick=()=>m.close(); form.onsubmit=async e=>{e.preventDefault();save.disabled=true; - try{if(await onsave(form)!==false)m.close();}catch(err){say(err.message,true);}finally{save.disabled=false;}}; + // A plain Error without an API status is the form's own check ("O código + // precisa ter de 3 a 30 letras"): guidance, not a failure, so it stays out + // of Sentry (DTF-WEB-Z). The API's refusals (apiError already reports + // them) and broken code (TypeError and the like) stay red. + try{if(await onsave(form)!==false)m.close();} + catch(err){say(err.message,!(err?.constructor===Error&&err.status===undefined));} + finally{save.disabled=false;}}; return m; } // The old name, for the dialogs of Usuários and the rework.