From a52856f3f67bafd2dc17db39e12719be01eae265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Wed, 18 Nov 2026 12:19:16 -0300 Subject: [PATCH] fix: a Kanban form's own check shows as a notice, not as an error for Sentry (DTF-WEB-Z) The coupon form checks its code on save and throws a plain Error with the reason; formDialog showed every error in red, so a typing mistake became an issue. A plain Error without an API status is now a notice; the API's refusals (already reported by apiError) and broken code stay red and reach Sentry. Co-Authored-By: Claude Opus 5.5 (1M context) --- web/kanban.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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.