Wish Would like to have "LastException.ErrorNum"

Discussion in 'Bugs & wishlist' started by Diceman, Aug 21, 2018.

  1. Diceman

    Diceman Member Licensed User

    I would like to have "LastException.ErrorNum" in addition to "LastException.Message".

    When Delphi throws an exception, we often look for the type of exception that was thrown and handle it differently.

    When the program encounters an exception, I would like to be able to determine what type of exception it is by examining an error number. The exception could be the result of an index error, db error, conversion error etc. and if I knew the error number, I could do additional processing or error handling. I don't want to have to parse the Message because a foreign language may complicate things or the message may change later.

    TIA
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Errors in Android do not have numbers.

    You can use GetType(LastException) to get the Java class name. It will be different based on the exception type.
     
    Diceman likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice