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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:52:08+00:00 2026-06-12T22:52:08+00:00

I am catching exceptions and for a specific exception class and error code within

  • 0

I am catching exceptions and for a specific exception class and error code within that class I do some custom handling. For all other exceptions, I want to use the generic error handler. Like such:

on E:EADSDatabaseError  do
  begin
    case E.ACEErrorCode of
      5132: 
        begin
        //Custom handling
        end;    
      else
        begin
          raise;
        end;
    end;
  end;
on E:Exception do
  begin
    //usual handling
  end;

For most codes in the original error, I want to fall through to the generic error handler. However, reraising it does not seem to allow the more general exception class handler to fire. (I’m not sure I would expect it to. I’ve never done this sort of thing before.)

Is my best option to have two try/excepts?

  • 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-12T22:52:09+00:00Added an answer on June 12, 2026 at 10:52 pm

    I can see 3 possible solutions,

    • what you said, two try except block
    • put your usual handling code to a procedure, and call it from both places
    • something like this

      on E:Exception do
      begin
        if ( e is EADSDatabaseError ) and
           ( EADSDatabaseError(e).ACEErrorCode = 5132 then
        begin
          //Custom handling
        end else
        begin
         //usual handling
        end;
      end;
      

    in this case I would use the third one.

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

Sidebar

Related Questions

I'm catching all exceptions within: java.lang.Throwable /page.xhtml java.lang.Error /page.xhtml But what If I get
I had someone mention to me that catching all exceptions is not necessarily good
I find myself handling exceptions without specifying an exception type when I call code
When catching an exception on a database reading/writing operation, what specific exceptions should I
I have code which is catching all exceptions in Global.asax protected void Application_Error(object sender,
I'm using util.control.Exception.catching to convert internal exceptions into an exception type specific to my
I'm catching exceptions in context managers, however I don't see all levels of reraised
By referring to C++ catching all exceptions try { int i = 0; int
In Java, is there any way to get (catch) all exceptions instead of catching
I'm working some with a database and catching exceptions to check for various conditions.

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.