Map contract and transaction errors to plain language

Đang mở
#12 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@nilhn9660 đang làm issue này rồi.

Từ ngày 22/11/2026.

  • #109 của @nilhn9660 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
blockchain

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
4
Merge trung bình
54 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Yormee-103/PayLoop

Tất cả issue của Yormee-103/PayLoop

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.