Map contract and transaction errors to plain language

Aperta
#12 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@nilhn9660 ci sta già lavorando.

Dal 22/11/2026.

  • #109 di @nilhn9660 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
blockchain

Direzione di ricerca

Start in web/lib/contract.ts at invokeSigned, where the 30-second poll timeout (NOT_FOUND) and the on-chain FAILED both produce the same "did not succeed" message, and at the trustline translation in /pay to see the existing pattern. Error codes 1-8 are defined in contracts/invoice/README.md. Add a mapper in a new lib/errors.ts that throws a typed PayLoopError. Done when Create and Pay show distinct messages for each code and for user-rejected signing and low XLM fees, a timeout shows the tx hash with "check the explorer" and never says "failed", and the mapper has unit tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

difficulty: intermediate enhancement help wanted Stellar Wave ux web

Difficulty: Intermediate

Description

Only the trustline error is translated (in /pay). Everything else reaches users as raw SDK text such as Error(Contract, #4). invokeSigned in web/lib/contract.ts also reports a 30-second poll timeout (NOT_FOUND) and an on-chain FAILED with the same "did not succeed" message.

Implementation suggestions

Create lib/errors.ts with a code-to-message map (codes 1-8 from contracts/invoice/README.md). Add handling for user-rejected signing, insufficient XLM for fees, and timeout. Throw a typed PayLoopError. On timeout, show the tx hash with "check the explorer" instead of "failed".

Acceptance criteria

  • Each of codes 1-8 and the other cases above shows a distinct, human-readable message on Create and Pay.
  • A timeout never claims the transaction failed.
  • Unit tests cover the mapper.

Dependencies / related

Tests use #13. Error paths are exercised by the E2E suite in #37. If #27 or #29 add new error codes, extend the map.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.