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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:50:47+00:00 2026-05-23T08:50:47+00:00

Is this try DoSomethingThatMightThrowAnException; except on E : ESyntaxError do begin if (E.ErrorCode =

  • 0

Is this

try
  DoSomethingThatMightThrowAnException;
except
  on E : ESyntaxError do
    begin
    if (E.ErrorCode = errMissingBracket) then
      HandleError
    else
      raise;
    end;
end;

slower than this?

try
  DoSomethingThatMightThrowAnException;
except
  on E : EMissingBracketSyntaxError do
    begin
    HandleError;
    end;
end;

What’s the difference to be expected? Does it matter? Note that this could happen several times through the call stack.

  • 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-05-23T08:50:47+00:00Added an answer on May 23, 2026 at 8:50 am

    I’ve had a quick look at the assembler the compiler spews out for above code snippets. Turns out that the bytes right after jmp @HandleOnExeption contain data such as the exception class pointers you use in the on clauses (if any).

    I’m not that well versed in assembler to know exactly what’s going on, but enough to understand what is roughly going on and come to this conclusion:

    I suspect System.pas’ HandleOnException does a call @IsClass already, and passes the exception on if no suitable handler is found, so if you use on e:Exception and re-raise, this will add a little code and make two calls extra:

    • one back to your exception handling section (in all cases)
    • one call @RaiseAgain (in cases the exception gets re-raised)

    So, there’s a difference. A minor one, but still, it’s there.

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

Sidebar

Related Questions

does anyone have an idea, why this Python 3.2 code try: raise Exception('X') except
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)
Currently I'm doing this: try: something = next(iterator) # ... except StopIteration: # ...
Consider this try / except block I use for checking error message stored in
I have a code like this: try: .... l.simple_bind_s(user, password) except ldap.CONNECT_ERROR, e: sys.exit(1)
I am doing this: try: self.failUnless(sel.is_text_present(F!)) #sel.is_text_present(F!) is false except AssertionError, e: print(x+e+y) sys.exit()
Right now, I do this: try: blah except Exception, e: print e time.sleep(9999) Instead
everyone, my python code is something like this: try: foo1() except FooError1: try: foo2()
For a block like this: try: #some stuff except Exception: pass pylint raises warning
I have code like this: try: request=parse_request except: print cannot parse your malformed 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.