Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7661567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:36:56+00:00 2026-05-31T13:36:56+00:00

With an exception that there is no solution or alternative to, for example failing

  • 0

With an exception that there is no solution or alternative to, for example failing to open an image, I usually do something like:

try
{
    img.load_from_file("my_image.png");
}
catch( const image_loading_exception& e )
{
    /* Could Not Load Image: 'my_image.png' ! */
    string err = "Could Not Load Image: " + e.what() + " !"; // 
    pro::message_box::show( err );
}

Now, is this really good error handling? Should I do something more descriptive, or try to resolve the issue. Displaying a error message box is the only thing that I can think of when handling image or file loading failure. What do you guys do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:36:56+00:00Added an answer on May 31, 2026 at 1:36 pm

    It depends what are requirements :

    • if the program can not continue because a critical image is missing, then it should stop the execution and inform the user what happened
    • if the user entered wrong parameter (for example, wrong file name), they should be informed and asked to enter it again
    • if it is something that is not important at all, then just log a message without informing the user
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way for something to raise and exception that does not descend
Why only one overload throws this exception? Little update: I understand that there was
Is there a way to detect, from within the finally clause, that an exception
Is there a way of doing a find_by_x that raises an exception if the
Is there an elegant way to handle exceptions that are thrown in finally block?
Is there anyway to determine the Exceptions that can be thrown by methods in
I'm looking to log unhandled javascript exceptions. Is there an event that fires when
One of my co-workers claims that even though the execution path is cached, there
This is the exception that I'm getting when I'm trying to bind to a
This is an intermittent exception that occurs intermittently in Umbraco 3.0.4 running in IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.