Closed jiande-my closed 1 year ago
Welcome @jiande-my !
it doesn't work properly
I don't have any idea what this mean. Could you please be more specific?
Related discussion: https://github.com/ArthurSonzogni/FTXUI/discussions/451
@ArthurSonzogni
int main()
{
try
{
MyFunc(256); //cause an exception to throw
}
catch (invalid_argument& e)
{
cerr << e.what() << endl;
return -1;
}
//...
return 0;
}
Example of C++ in Error Handling.
Do FTXUI have this kind of features. If the program have error instead stop the program display segmentation fault
but instead some error message so that we know where the error is.
Yes, this is C++ errors. You can wrap your throwing block with try/catch if you want to handle errors. You are free to do it yourself.
FTXUI will never handle your errors for you. Also, FTXUI guarantee it works with exceptions disabled.
If you want some "global" error handling. Feel free to wrap the loop function and restart from a new ScreenInteractive
.
while(true) {
try {
auto screen = ScreenInteractive::FitComponent();
screen.Loop(component);
} catch (error) {
[...]
}
}
Out of curiosity. Why do you need to use C++ exception at all?
I am archiving this, because there are no more activity.
Hi, @ArthurSonzogni, CC: @SAtacker
I have try using C++ exceptions in FTXUI, but it doesn't work properly. Any recommendation to handle errors in FTXUI.
Thanks