Skip to content

Feature/issue 63 verification and fixes#134

Open
Robinsonchiziterem wants to merge 5 commits intoSplit-Naira:mainfrom
Robinsonchiziterem:feature/issue-63-verification-and-fixes
Open

Feature/issue 63 verification and fixes#134
Robinsonchiziterem wants to merge 5 commits intoSplit-Naira:mainfrom
Robinsonchiziterem:feature/issue-63-verification-and-fixes

Conversation

@Robinsonchiziterem
Copy link
Copy Markdown
Contributor

#63 Pull Request: Structured Error Mapping & Project Stability Fixes

Overview

This PR implements structured error handling for the backend (Issue #63) and resolves several project-wide build and stability issues discovered during verification.

Key Changes

🛡️ Backend (Issue #63)

  • Centralized Error Handling: Introduced ApiError class for consistent { error, message, details?, requestId } responses.
  • Soroban Mapping: The global error handler now maps specific Soroban contract error codes (#1–13) to appropriate HTTP status codes (400, 403, 404, 409) and human-readable messages.
  • Infrastructure Safety: Added handled cases for Soroban simulation failures (502) and missing server configurations (503).
  • Refactored Routes: Simplified splits.ts by removing duplicated try-catch blocks and using validateRequest middleware for unified Zod validation.

🎨 Frontend Stability

  • Fixed Build Failure: Added missing @tailwindcss/postcss, autoprefixer, and postcss dependencies required for Next.js Turbopack.
  • TypeScript Bug Fix: Corrected a type mismatch in split-app.tsx where an XDR result was being passed directly to the Error constructor; it now correctly uses errorResult?.toString().
  • Verified Build: Confirmed npm run build and npm run lint now pass with Exit Code 0.

📜 Contracts

  • SDK Update: Bumped soroban-sdk to 21.0.0 to resolve dependency conflicts (specifically proc-macro2) with modern Rust toolchains.

Verification Results

  • Backend: Verified all error mappings using a custom verify-errors.ts script (all 13 contract codes mapped correctly).
  • Frontend: Successfully completed a full production build and lint.
  • Backend Build: npm run build and npm run lint pass.

Related Issues

Closes #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Add structured error responses (map Soroban failures)

1 participant