feat: every error shown in red reaches Sentry, also the ones the page handled itself
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled
Until now only failed API calls and uncaught exceptions reached Sentry. An error the page caught and showed, like the folders' "A última tentativa falhou" Marcus photographed on 16/11, or an upload that failed on the Site, never did. Now every red message in the Kanban, the Site's checkout, the customer's account page and every failed upload is sent, one issue per kind of message; the same text an API error already sent, or a 401 / restart 503 it skips on purpose, is not sent twice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,4 +47,19 @@ assert.notDeepEqual(
|
||||
apiError('/quotes/ba39b432-b0d1-4b1b-8971-09123e067067', 422, expired).options.fingerprint,
|
||||
apiError('/orders/ba39b432-b0d1-4b1b-8971-09123e067067', 422, expired).options.fingerprint);
|
||||
|
||||
// Every red message reaches Sentry, also one the page caught itself; the
|
||||
// same text an API error already sent (or deliberately skipped) is not doubled.
|
||||
captured = null;
|
||||
window.dtfObservability.uiError('Pastas automáticas: A última tentativa falhou: DTF-26-item-1.png bloqueado.', 'kanban');
|
||||
assert.ok(captured, 'uiError sends a caught error');
|
||||
assert.equal(captured.message, 'Aviso kanban: Pastas automáticas: A última tentativa falhou: :arquivo bloqueado.');
|
||||
assert.deepEqual(captured.options.fingerprint, ['ui-error', 'kanban', 'Pastas automáticas: A última tentativa falhou: :arquivo bloqueado.']);
|
||||
apiError('/orders', 409, 'Falta a foto da revisão.');
|
||||
captured = null;
|
||||
window.dtfObservability.uiError('Falta a foto da revisão.', 'kanban');
|
||||
assert.equal(captured, null, 'an API error shown in red is sent once');
|
||||
window.dtfObservability.apiError('/board', 503, 'O sistema está reiniciando.');
|
||||
window.dtfObservability.uiError('O sistema está reiniciando.', 'kanban');
|
||||
assert.equal(captured, null, 'a skipped restart 503 stays skipped');
|
||||
|
||||
console.log('observability web checks passed');
|
||||
|
||||
Reference in New Issue
Block a user