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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:11:17+00:00 2026-06-05T06:11:17+00:00

I am Studying about Exceptions At W3schools At this Link , inside the link

  • 0

I am Studying about Exceptions At W3schools At this Link, inside the link just before the heading:

“Re-throwing Exceptions”

there is a sentence that say:

“If the exception thrown were of the class customException and there
were no customException catch, only the base exception catch, the
exception would be handled there.”

If can someone please give me an example for this sentence i will be very thankful.

  • 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-05T06:11:18+00:00Added an answer on June 5, 2026 at 6:11 am

    Say you have a custom exception defined as

    class CustomException extends Exception.

    Now somewhere in your code:

    try
      {
      // do something that throws a CustomException
      }
    
    catch(Exception $e) // you are only catching Exception not CustomException,
    // because there isn't a specific catch block for CustomException, and
    // because Exception is a supertype of CustomException, the exception will 
    // still be caught here.
      {
      echo 'Message: ' .$e->getMessage();
      }
    

    So what it means is that because CustomException is a subclass of Exception, as long as you catch the Exception type of the superclass without a catch block for the more specific sub class type, it will still be caught

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

Sidebar

Related Questions

We were studying about compilers at college so this raised me curiosity that when
I am studying the CodeCampServer. I am confused about the ASP.NET MvcContrib.CommandProcessor.RulesEngine. Are there
I'm studying for Java Programmer Certification (SCJP) exam. A question about exceptions, when handle
I'm studying about the new Process Manager that came automatically with MPICH2, but until
I'm studying for SCJP, and my book (Sierra's) says about the Formatter class that
I've been studying about k-means clustering , and one thing that's not clear is
When I am studying about Turing machines and PDAs, I was thinking that the
I just started studying programming about 6 months ago and I have really been
I am studying Software Engineering this year and I am little confused about the
I'm studying about implementing Comet in my application. I got that for each request

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.