Skip to content

Commit d072be8

Browse files
dadachiclaude
andcommitted
Add CodedError system documentation to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 236bbcb commit d072be8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ MVVM layered architecture following [Android Modern App Architecture](https://de
4848
- **Navigation routes**: Defined as extension functions on `NavGraphBuilder` (e.g., `shopListView()`, `navigateToShopDetail()`). Routes use type-safe navigation.
4949
- **Proto DataStore**: User preferences and NFC scan state are persisted via Protocol Buffers (lite).
5050

51+
## Error Handling (CodedError System)
52+
All errors should use the `CodedError` interface. Error codes use the `NATA-XXXX` prefix (NativeAppTemplate Android).
53+
54+
| Range | Type | Description |
55+
|-------|------|-------------|
56+
| NATA-1xxx | App/general errors | Unexpected errors, catch-all |
57+
| NATA-2xxx | API/network errors | HTTP request failures, parsing errors |
58+
| NATA-3xxx | NFC/scan errors | NFC tag read/write/scan failures |
59+
| NATA-6xxx | Subscription errors | Purchase, restore, offering failures |
60+
61+
- New error types must implement `CodedError`
62+
- Use `codedDescription` (not `message` or `localizedMessage`) in all user-facing error messages — this prepends `[NATA-XXXX]` for `CodedError` types
63+
5164
## Testing
5265

5366
- Tests use JUnit 4 with `kotlinx.coroutines.test` and Robolectric.

0 commit comments

Comments
 (0)