-
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
Problem:
It is not always clear when an error is thrown in a lower-level function, what higher-level function calls caused running into this error situation. It's important to understand what screen or feature the users were using when they ran for example into a database-level error.
I think we need some kind of "error identification trace" here, e.g. with characters like in this suggestion:
- We build a tool that can scan the source code of projects.
- While scanning it detects all the errors conforming to
Throwable
and their cases (if they are enums). - While scanning it also detects all functions that use typed throws with their context type, name, and error type.
- All error types get assigned a short unique ID (e.g.
DFG
), and all cases within an error also get a unique character (if less than 26 cases). - When developers are in a function that throws error type
A
, but call a function that can throw error typeB
, then this is also auto-detected by looking it up in the table. - In such a case, the tool automatically adds a nested
case b(B)
inside theA
error type, because A could throw a B error if the inner function throws. - We could even provide a visual editor for error types and cases with an hierarchy overview that auto-generates all error cases from the app.
- So users would end up having one Swift file that is auto-generated with all error cases and localized error messages (auto-localized in the app?).
@n0rthk1n9 What do you think? Sounds good? Sounds like too much? Did I even describe it well? 😅
Metadata
Metadata
Assignees
Labels
No labels