-
Notifications
You must be signed in to change notification settings - Fork 22
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
Color-formatted messages thrown as exceptions #402
Comments
Agree 100%; the library is being not helpful by formatting this. |
I'll take care of it. I believe, since it is an I/O library, it should not log errors, but rather just throw the exception and let the calling application handle it. Is that an acceptable behaviour? |
Hold off a moment on that; I need to remember why it was done this way, as opposed to throwing exceptions; I believe there are some 'errors' that are 'acceptable', but I need to look into it more. I think it's worth discussing and figuring out how better to handle errors. At the momemnt there is a |
Yes, there is a list of ignored warnings that is static.
Then, by default, it would be initialized to a MorphIO implementation that emulates the current behaviour (and would have a non static member list of ignored warnings), but would allow the caller to modify the behaviour by providing a custom implementation. What do you think? Maybe this solution is too tailored to my use case, I am not sure if its too big of a change. |
Hellow:
The following code format error messages with colors:
MorphIO/include/morphio/errorMessages.h
Line 126 in 95fa476
These messages are being thrown as exceptions. Brayns captures these exceptions to send them back to the connected clients as informative messages, however, they contain the color-format characters, as follows:
I believe it would be better to throw the exceptions unformatted, and maybe add the format if MorphIO decides to log the message to some output.
The text was updated successfully, but these errors were encountered: