Skip to content

[Bug] mobileAuth.ts "not initialized" error lacks actionable information for callers #790

Description

@RUKAYAT-CODER

Overview

mobileAuth.ts throws a generic "not initialized" error when the service is used before initialize() is called. Callers cannot determine which dependency (Redis client, SecureStore, JWT secret) failed to initialize.

Specifications

Features:

  • Create a structured AuthInitializationError class with a missingDependency field
  • List the specific dependency that was not ready

Tasks:

  • Define AuthInitializationError extends Error with context fields
  • Throw it with the dependency name in each guard clause
  • Update callers to handle the new error type

Impacted Files:

  • src/services/mobileAuth.ts
  • src/types/errors.ts (new or existing)

Acceptance Criteria

  • Error message includes the name of the uninitialized dependency
  • Callers can instanceof check for AuthInitializationError
  • TypeScript types for the error class are exported

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions