- Notifications
You must be signed in to change notification settings - Fork20
Open
Description
What & Why
NuMojo currently defines several custom error types. For example,ShapeError,IndexError, andMemoryError.
However, these are not used consistently across the codebase. Some parts still raise generic errors (e.g.raise Error(...)), which makes debugging harder for users and contributors. To improve developer experience and ensure clearer error messages, we should standardize error handling throughout the project.
Proposed Solution
- Refactor all instances of raise Error(...) (and other generic exceptions) to use the appropriate custom error types, such as ShapeError, IndexError, or MemoryError.
- Add new custom error types where existing ones don’t fit the context, ensuring each has a clear purpose and message.
- (Optional but encouraged) Add or update tests to verify that the correct error types are raised in relevant scenarios.