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
Overview
mobileAuth.tsthrows a generic "not initialized" error when the service is used beforeinitialize()is called. Callers cannot determine which dependency (Redis client, SecureStore, JWT secret) failed to initialize.Specifications
Features:
AuthInitializationErrorclass with amissingDependencyfieldTasks:
AuthInitializationError extends Errorwith context fieldsImpacted Files:
src/services/mobileAuth.tssrc/types/errors.ts(new or existing)Acceptance Criteria
instanceofcheck forAuthInitializationError