Map contract and transaction errors to plain language

Abierto
#12 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@nilhn9660 ya está trabajando en esto.

Desde el 22/11/2026.

  • #109 de @nilhn9660 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
blockchain

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
4
Merge medio
54 min
PR fusionados (30 d)
6

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Yormee-103/PayLoop

Todos los issues de Yormee-103/PayLoop

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.