Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error Handling  (Read 3436 times)

0 Members and 1 Guest are viewing this topic.

Ant

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Error Handling
« on: September 10, 2014, 07:08:23 am »
I was curious about the error handling system for SFML.  For example, SFML may be unable to import an image if an artist specifies incorrect parameters.  When that happens, I would like to display a meaningful message to them.  I did read an old post about this topic...
http://en.sfml-dev.org/forums/index.php?topic=4643.0

I am curious if there are any news about error handling since that post.  If not, are there any plans for displaying error messages?

Thanks for the support!

-Ant

Strelok

  • Full Member
  • ***
  • Posts: 139
    • View Profile
    • GitHub
Re: Error Handling
« Reply #1 on: September 10, 2014, 07:27:18 am »
If I recall correctly SFML 3 may use exceptions.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Error Handling
« Reply #2 on: September 13, 2014, 05:28:18 pm »
For SFML 2.x there won't be a change in error handling, that is you get a bool for success/failure and a hardcoded message via sf::err(), which if not redirected will print an error to std::cerr.

For SFML 3 we'll most likely be using exceptions, but there's nothing written about how etc. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ant

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: Error Handling
« Reply #3 on: September 15, 2014, 06:32:48 am »
Thank you for the information.

I'll settle for the redirect solution for the time being.  I'll apply the exception solution when it's ready.  I'm looking forward to SFML 3!