Skip to content

Add SDK error recovery suggestion engine #239

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

src/errors.ts's typed errors are precise but don't suggest remediation. This issue adds a mapping from known error types to actionable suggestion strings, useful for surfacing helpful UI messages automatically.

Technical Context

New src/errorSuggestions.ts. getSuggestion(error) pattern-matches against the typed errors exported from src/errors.ts (and contract errors via src/proof.ts's/parseSorobanError-style parsing) and returns a human-readable next step.

Acceptance Criteria

  • getSuggestion(error) returns a suggestion string for at least 10 distinct known error types, and a generic fallback for unknown ones
  • Suggestions are data-driven (a lookup table), not embedded in conditional logic, for easy extension
  • Exported from src/index.ts
  • Tests: each mapped error type returns its specific suggestion; unmapped error returns the fallback

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions