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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:10:19+00:00 2026-05-15T22:10:19+00:00

Possible Duplicate: Unchecked exceptions in Java: Inherit from Error or RuntimeException? Looking at how

  • 0

Possible Duplicate:
Unchecked exceptions in Java: Inherit from Error or RuntimeException?

Looking at how our applications do error handling, we have been steadily moving from a checked ExceptionHierarchy (e.g. Exception -> ApplicationException -> SomethingSpecificBadHappenedException) since in many cases we have many long call chains that just pass up ApplicationException, and it adds little value but cluttering our API (we increasingly agree with the opinions expressed in: Effective Exceptions.

In redesigning our error handling around unchecked exceptions, aligned with a “fault barrier” approach, we initially have started working with a RuntimeException based hierarchy, similar to the example in the Spring Data Access layer

We’ve been starting to wonder if it would be more clear to have them descend from Error, especially around the fact that it would let us do something like a:

} catch (Exception e) {

within our application in a number of spots, but then differentiate with:

} catch (Throwable t) { or } catch (Error err) {

which feels cleaner, though I can’t think of major examples of APIs following this. Am looking for examples from preferably common APIs of where to root our exception/error hierarchy, or comments on style or functional differences that should dictate one root in preference to the other.

  • 1 1 Answer
  • 1 View
  • 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-15T22:10:20+00:00Added an answer on May 15, 2026 at 10:10 pm

    In addition to the other answers: You should not catch Error or Throwable without rethrowing in “normal” program logic. The main reason I can think of for catching a subclass of Error is this: You are using your own class loading system and want to isolate broken plugins.

    The JavaDoc for ThreadDeath says:

    An application should catch instances of this class only if it must clean up after being terminated asynchronously. If ThreadDeath is caught by a method, it is important that it be rethrown so that the thread actually dies.

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

Sidebar

Related Questions

Possible Duplicate: How to call a JavaScript function from PHP? I have a php
Possible Duplicate: Extracting dollar amounts from existing sql data? I have a column in
Possible Duplicate: When to choose checked and unchecked exceptions When should I create a
Possible Duplicate: Why do I get a null pointer exception from TabWidget? I have
Possible Duplicate: Why are Exceptions not Checked in .NET? Java makes distinction of checked
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Open a new prompt/terminal window from Java Is it possible to open
Possible Duplicate: Using ApplicationSettings to store Checked property for WinForms RadioButtons I have three
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: How do I make a list with checkboxes in Java Swing? I

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.