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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:22:57+00:00 2026-06-14T08:22:57+00:00

If I have unhandled exception in Java, Eclipse proposes two options to me: (1)

  • 0

If I have unhandled exception in Java, Eclipse proposes two options to me: (1) add throws declaration and (2) surround with try/catch.

If I choose (2) it adds a code

try {
   myfunction();
} catch (MyUnhandledException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

I want to change this to

try {
   myfunction();
} catch (MyUnhandledException e) {
    throw new RuntimeException(e);
}

Is this possible?

UPDATE

Why are so love to change the topic people???

If exception is catched and printed it is also no need to catch it anymore. I like my application to crash if I forget to handle an exception by mistake. So, I like to rethrow it by default.

  • 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-14T08:22:59+00:00Added an answer on June 14, 2026 at 8:22 am

    Yes, you can change the default code added by Eclipse.

    1. In Preferences, navigate to Java>Code Style>Code Templates.
    2. Under Code, select Catch block body.
    3. Press the Edit button to change the code. When finished, press the
      OK button.

    Consider adding a TODO comment in the default catch block. For example, the default includes:

         // ${todo} Auto-generated catch block
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question I have a third-party DLL that throws an unhandled exception when attempting to
I have a global exception handler in program.cs to catch unhandled exceptions. Unhandled Exception:
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to
I have receive an Visual Studio Just-In-Time Debugger Error An Unhandled Exception(Unhandled Error in
I want to know whether unhandled exception will make WCF service crash. I have
Our C# application calls MinidumpWriteDump upon an unhandled exception. I have received some crash
I have an unhandled exception handler. It shows a nice GUI and allows users
We have some error reporting code that, when an unhandled exception occurs, we send
I have handling the exception in my code as below, but still get error
An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll Additional information: Parameter is not

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.