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 6578109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:43:43+00:00 2026-05-25T15:43:43+00:00

Can you recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (Java,

  • 0

Can you recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (Java, C++, Perl, PHP)?

Some errors need to be reported.

Some errors can be handled internally (by a retry or are inconsequential (can be ignored).

How do you structure the code to catch them?

But all errors need to be logged.

What best practises are there?

And for simulating them to be able to fully test components that are impacted by them?

General non-programming-language specific question applicable to several modern programming languages but would welcome example illustrations of patterns, approaches and philosophies in Java, C++, PHP and Perl.

  • 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-25T15:43:45+00:00Added an answer on May 25, 2026 at 3:43 pm

    My philosophy involves always attempting to catch errors where they happen. Things like global exception handlers make for a difficult debugging process. Keep error handling as local to the site of the failure as possible. Debugging is easier, and it avoids non-specific error reporting that tends to confuse and frustrate users.

    In terms of logging, that’s an implementation decision. I usually have some reporting utility functions sitting around that I invoke whenever I detect an error condition. Obviously you can vary the logging level such that certain serious errors are reported. Similarly, if your application should exit with an error, do that as quickly as possible.

    Simulation and testing are somewhat orthogonal. To test your error-handling code completely, you should be able to write test cases that cause each error to occur. It may involve contriving inputs or altering state. If you errors are not dependent on inputs or interaction with external systems, then you should really consider whether that’s a failure condition, or just an implementation bug that is sporadically triggered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody recommend a class library or a design pattern that models amounts of
Can anyone out there recommend a good online resource for CSS 'design patterns'? I
I'm wondering if anyone can recommend a good C++ tree implementation, hopefully one that
Are there any popular Mysql rss feeds you guys can recommend? IBM has random
can you recommend some good ASP.NET tutorials or a good book? Should I jump
Can anyone recommend a good library for generating an audio file, such as mp3,
Can anyone recommend some good resources that highlight the differences between Oracle and the
Can anyone recommend a good binary XML format? It's for a JavaME application, so
Can anyone recommend software or a .NET library that will check for bounced emails
can anybody recommend some really good resources for how to get Apache authenticating users

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.