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

  • SEARCH
  • Home
  • 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 9013217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:12:19+00:00 2026-06-16T03:12:19+00:00

in OO programming, is there some conceptual pattern, ideas, about handling multiple errors? for

  • 0

in OO programming, is there some conceptual pattern, ideas, about handling multiple errors?

for example, i have a method that performs some checks and should return an error message for each error found

[‘name is too short’, ‘name contains invalid unicode sequences’, ‘name is too long’]

now, should i use an array of exceptions (not thrown exceptions)?

or something like this is better:

class MyExceptionList extends Exception{
  public Void addException(Exception e){}
  public Array getExceptions(){}
}

any theory behind this argument will be appreciated!

(this isn’t a request about a specific programming language, but a pure theoretical one)

thank you in advance

  • 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-06-16T03:12:20+00:00Added an answer on June 16, 2026 at 3:12 am

    Unfortunately, many languages and frameworks (including C++, Java, and .net) use an exception-handling mechanism which requires the type of an an exception object to simultaneously answer many questions, including:

    1. What happened
    2. What actions need to be taken beyond stack unwinding
    3. At what point should the system be considered to be in a “known” state, at least with regard to the problems indicated by the exception.

    Unfortunately, while the answers to those questions are somewhat related, they are in reality far from 100% correlated. Unfortunately, the assumption that the type of an exception will be sufficient to answer all of those questions makes it difficult to deal sensibly with many situations.

    If you have control over all the exceptions that can be thrown, it may be helpful to use an exception-handling paradigm where the exception-handling object includes a virtual IsResolved property or method along with a ShouldCatchAs<T> property or method that returns a T if the exception needs to be handled as a T. Such a paradigm would be able to smoothly handle situations where an exception occurs while unwinding the stack from an earlier exception (the existing exception and new one would be wrapped into a composite exception object, whose ShouldCatchAs property would combine those of the original exceptions, and whose IsResolved property should only return true when both of the original exceptions’ IsResolved properties do likewise).

    I don’t know any way to integrate such behavior into the existing frameworks unless one catches and wraps all exceptions that don’t fit the paradigm, but perhaps future frameworks can facilitate such things.

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

Sidebar

Related Questions

Is there some way to avoid this. I have a lot of classes that
I use FDT for my flex programming and there are some warnings that I
Are there any PIC microcontroller programmers here? I'm learning some PIC microcontroller programming using
Almost anywhere I read about programming with CUDA there is a mention of the
im currently reading a book about programming Android and there is a nice little
Is there some way to make Eclipse or JDK 1.7 to utilize multiple cores
Over the course of programming I get errors that give a resource number like
Often in programming, it is a very common requirement that some piece of functionality
The problem we have now in your development process, is that there are a
I have been doing some Winsock programming lately. I do not do much stuff

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.