From 79be9538bb8ccf9350e5e4cb71150e92440fdcb6 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 30 Apr 2024 17:45:33 -0300 Subject: [PATCH] fix: ignorar los errores de abort de htmx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit el problema es que cuando se envĂ­a un abort a htmx, se loguea un mensaje de todas formas. closes #15880 closes #15881 closes #15883 closes #15884 closes #15893 closes #15894 closes #15973 closes #15974 closes #15975 closes #16003 closes #16004 closes #16015 closes #16016 closes #16023 closes #16024 closes #16050 closes #16051 closes #16063 closes #16064 closes #16073 closes #16074 closes #16116 closes #16125 closes #16126 --- app/javascript/packs/application.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index d8ff0dd1..e10e2b5d 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -9,9 +9,16 @@ try { host: window.env.PANEL_URL }); + const ignoredErrors = ["htmx:afterRequest", "htmx:sendAbort"]; + console.originalError = console.error; console.error = (...e) => { - window.airbrake.notify(e.join(" ")); + const msg = e.join(" "); + + if (!ignoredErrors.some(x => msg.includes(x))) { + window.airbrake.notify(e.join(" ")); + } + return console.originalError(...e); }; } catch(e) {