SFML community forums
Help => General => Topic started by: pauljurczak on September 05, 2015, 11:24:50 am
-
I've built my first SFML program and I noticed that functions like loadFromFile send a text error message to the console when they fail. I can't find a description of this side effect in the documentation. Is this text being sent to std::cerr stream? Is there an option to throw an exception instead or in addition to this error message?
-
The error messages are sent to sf::err(), a stream which can be redirected as you like.
No, SFML doesn't throw any exceptions at the moment. To load resources like textures, sound buffers, etc., you can use Thor's Resource module (http://Thor's Resource module) which automates a lot and also throws exceptions if loading fails.
-
Thanks. I had hard time finding this before, but now your answer directed me to the description of sf::err(), which makes it clear. Maybe it could be referenced somewhere at top level of documentation as a general way of handling error conditions.