Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Error Handler and test errors #106

Open
MirkoCalvi opened this issue Nov 22, 2024 · 2 comments
Open

Improve Error Handler and test errors #106

MirkoCalvi opened this issue Nov 22, 2024 · 2 comments

Comments

@MirkoCalvi
Copy link
Collaborator

MirkoCalvi commented Nov 22, 2024

Feature Description

errorHandler must be more descriptive and must have some service function to print details or give feedbacks.

Problem Statement

At the moment error handling implements a errorDetails(myError: anyerror). Errors are not always good tested.

Suggested Solution

Propose an elegant solution to cover all possible type of errors.

Huly®: X_PI-136

@MirkoCalvi
Copy link
Collaborator Author

I add here a suggestion for the tests of the ErrorHandler. It would be great to have a union that collects all the classes of errors like
LayerError, TypeError, TensorMathError and so on, and in the tests iterate over that class so to ensure that all the errors of each class have a errorDetails() output.

@MirkoCalvi
Copy link
Collaborator Author

MirkoCalvi commented Dec 25, 2024

Around the code there are some error.ErrorSomething. It would be great to use only the error types of errorHandler.zig.
More in general some errors are overused and sometimes they give wrong information about the real error.
For example:
if (out_channels != weight_out_channels) { std.debug.print("Error: Mismatched output channels: dValues {d}, weights {d}\n", .{ out_channels, weight_out_channels }); return TensorMathError.InputTensorsWrongShape; }
inside tensor_math.zig.
In this case the error InputTensorsWrongShape is not the right one, It could put you on the wrong path while debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant