How to get Exception reason

Hi,
I'm little bit confused about what Javacard programmer do, when his code raises an exception. I mean, when it happens in JavaSE, it's very simple to see exception reason with getStackTrace() or getMessage(). but JavaCard's Exception class does not have printStackTrace method (because usually there is nothing to print on :D ) and does not even has a String class to use getMessage. so is there any common way to see exception reason ? some exceptions have getReason method, but AFAIK most of them does not.
BR.

Hi,
You can use something like this to propagate the error to the APDU interface:
try {
    doSomethingThatThrowsException();
catch(SomeException e) {
    ISOException.throwIt((short)(0xa000 + e.getReason()));
}This will give you a status word of 0xa00R where R is the reason code.
Cheers,
Shane

Similar Messages

  • How to get Exception detail

    Hi,
    I have attached Catch all activity to my process. Inside process calling database procedure that throws no data found exception. I want to capture in catchAll fault.
    I tried ora:getFaultAsString and ora:getFultName xpath function.
    But first one result whole exception as node string. so can not se real exception message.
    second one generates exception can not parse xpath query FOTY0001.
    I tried to do expression ora:getFaultName() to simple type variable of QName.
    My requirement is just get exception whatever my process is throwing in catchall block.
    Any suggestion?

    Hi
    I don't think I have done anything different
    I had 10.1.3.1 version which had the bug
    The bug was 5841736(CANNOT GET THE DETAIL MESSAGE OF RUNTIME FAULT IN 'SUMMARY' AND 'DETAIL' PART WITH ora:getFaultAsString EXPRESSION)
    The SOA 10.1.3.3 patch set 3 ( as it reads) has this bug fixed.So I installed this verison over the current oracle_home and the problem got solved :)
    Hope this helps,
    Ketan

  • For some reason the system is telling me my birth date is wrong when it's not and it won't let me proceed to reset my password. Can someone tell me how to get a "real" person from tech on line?

    For some reason the system is telling me my birth date is wrong when it's not and it won't let me proceed to reset my password. Can someone tell me how to get a "real" person from tech on line?

    contact itunes support

  • How to get a question in the course placed anywhere in the course and does not appear in the quiz result or total number of questions. Pretest would work except it can't go anywhere in the course (at least for me it can't)

    How to get a question in the course placed anywhere in the course and does not appear in the quiz result or total number of questions. Pretest would work except it can't go anywhere in the course (at least for me it can't)

    Use a normal question, and do not add the score to the total score. That will give you a correct score at the end. But the total number of questions, that system variable will still take into account all questions. You'll need a user variable, and calculate its value by subtracting 1 from the system variable cpQuizInfoTotalQuestionsPerProject. Same for the progress indicator if you want to show it?
    Customized Progress Indicator - Captivate blog
    If you want to allow Review, you'll have to tweak as well. You didn't specify the version, and all those questions I now mentioned.
    And my approach, since you talk about only one question: create a custom question, because you'll have total control then.

  • "services" in application menu disappeared except in Finder - how to get back

    not quite sure what happend - but except in Finder - almost all "services" disappeared.
    Don't know how to get them back.
    Can't find any settings - Service setting in System settings are all ticked
    Thanks

    Hi Karen,
    Work through this and you should be able to get it back: http://support.microsoft.com/kb/2026220

  • How to get only current exception message from tables

    Hi
    In my sceanario , I want to have the list of Current MRP exception messages list from table
    I understand that MRP detailed lists, including all exception messages, are stored in transparent table MDKP and cluster table MDTC.
    I can tell ABAPer to write a report for me , to read the data from these tables , but I guess these tables contain old exception message also , which are not currently appearing in MRP list
    How to get only current exception message
    Rgds,
    sandeep

    Sandeep,
    MDTC contains only data from the most recent MRP run.  So, all messages you see are those which are currently valid.
    The messages might have first appeared during a previous run, but they still need to be addressed.
    Before you invest a lot of time and effort into writing and debugging a custom report, you should probably try to use the standard SAP functionality found in MD06.  On the Processing indicator tab, you can select "Only with new exceptions".  Here you can tag a material/plant as 'processed', and thereafter, the exceptions that existed there before you tagged the part will not be re-displayed.
    Best Regards,
    DB49

  • How to get text of exception in my program, exception is defined in FM?

    I have written a function module where i have defined a couple of exceptions. If an error occurrs i raise the exception.
    My issue is, in my calling program, i call the function module i have created and once the exception occurrs i need to get the text associated with that exception.
    I dont know how to get the text of the exception. The short text is defined in exception tab of the function module.
    Any help will be appreciated.
    Thanks

    hi check this example..
      RECEIVE RESULTS FROM FUNCTION 'ZMARD_DATA'
         IMPORTING
           E_RECORDS  = g_records
         EXCEPTIONS
           no_data                            = 1
           open_dataset_no_authority          = 2
           convt_codepage_init                = 3
           dataset_too_many_files             = 4
           unknown_file_opening_error         = 5
           dataset_write_error                = 6
           dataset_not_open                   = 7
           dataset_cant_close                 = 8
           OTHERS                             = 9.
      CASE sy-subrc.
        WHEN 0.
          error_rec-msg_text     = 'Data Loaded'.
          g_total_rec = g_total_rec + g_records.
        WHEN 1.
          error_rec-msg_text     = c_no_data.
        WHEN 2.
          error_rec-msg_text     = 'OPEN_DATASET_NO_AUTHORITY'.
        WHEN 3.
          error_rec-msg_text     = 'CONVT_CODEPAGE_INIT'.
        WHEN 4.
          error_rec-msg_text     = 'DATASET_TOO_MANY_FILES'.
        WHEN 5.
          error_rec-msg_text     = 'UNKNOWN_FILE_OPENING_ERROR'.
        WHEN 6.
          error_rec-msg_text     = 'DATASET_WRITE_ERROR'.
        WHEN 7.
          error_rec-msg_text     = 'DATASET_NOT_OPEN'.
        WHEN 8.
          error_rec-msg_text     = 'DATASET_CANT_CLOSE'.
        WHEN 9.
          error_rec-msg_text     =
                  'Unknown error calling FM : ZMIO_GET_MARD_DATA'.
      ENDCASE.

  • How to get short text of a exception thrown by abap rfc

    Hi buddy,
    I use jco to communicate with backend, an abap function module will raise a exception. I can catch that exception,
    The example exception is:
    <b>Exception</b>     <b>Short text</b>
    Test                   This is exception test.
    e.getKey()
    will return TEST.
    Does any know how to get that short text "This is exception test." from the exception I caught?
    Thanks
    Austin

    Hi Austin,
    There are 2 methods to raise errors in function modules.
    1) Using the raise Exception statement
    2) Using a return structure like BAPIRET to populate the message details like type, error number, error text etc.
    Generally method 1 is not recommended for any RFC/BAPI function modules because it causes the calling program to crash if the function raises an exception. Method 2 is the recommended way and is used in all standard BAPI's. ABAP programmers are advised to code RFC's as per method 2, but some times it would not be possible as the function would already be used and could be barred from changes.
    But whatever method the RFC uses to raise an exception, web dynpro can handle it in the following ways,
    Method 1) If the RFC raises an exception using RAISE EXCEPTION,
    Dont catch Exception class in your code, instead do the following,
    catch (WDDynamicRFCExecuteException e) {
                      wdComponentAPI.getMessageManager().reportException(
                            e.getLocalizedMessage(),
                            true);
    Method 2) If the function returns the errors in the standard bapi return structure, you can do the following
                IWDMessageManager MsgMgr = wdComponentAPI.getMessageManager();
                for (int i = 0; i < ReturnNode.size(); i++) {
                      if (Types.indexOf("S") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "S"))
                            MsgMgr.reportSuccess(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));
                      if (Types.indexOf("W") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "W"))
                            MsgMgr.reportWarning(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));
                      if (Types.indexOf("E") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "E"))
                            MsgMgr.reportWarning(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));

  • For some reason I do not have a location bar on my browser and need to know how to get it back.

    For some reason I do not have a location bar on my browser and need to know how to get it back. Where or what do I click on?
    Thanks.

    Thanks so much. I just have to become more familiar with Foxfire, but I really like it. Thanks again for the help.

  • How to get the real reason of bdb's err?

    The application used some bdb's c-funcs, and get a err-log like below:
    PANIC: fatal region error detected; run recovery
    txn_checkpoint: log failed at LSN [1 6638626] DB_RUNRECOVERY: Fatal error, run database recovery
    How to get the real reason of the err?
    I tried to using db_printlog. But it print all the info of the log file. Another question is:
    How to get the info of exact place?

    The question is still there. Could someone help me?

  • How do get rid of the twitter app when there's no trace of it except for update notices on app store and that too with a stranger's id ??

    How do get rid of the twitter app when there's no trace of it except for update notices on app store and that too with a stranger's id ??

    ayk74,
    so you have no idea where some of your installed software originally came from?

  • Can anyone tell me how to get crossfade to work...was working ok, but now for some reason when i click on a track and try to drag on a fade it just highlights the track but does not leave a fade on?

    can anyone tell me how to get crossfade to work...was working ok, but now for some reason when i click on a track and try to drag on a fade it just highlights the track but does not leave a fade on?

    Hello mate!
    Are you sure u have the option on the up-right side of the arrange window checked to x-fade?

  • How to get JCORBA exception object message

    Hi I have this problem
    say:
    I have a JCORBA server and
    a method that throws an exception "A"
    I build the client program
    inside the client program I want to know
    if an exception "A" raised how to get the
    message inside "A"
    I have tried this
    ExceptionA extends Exception
    ExceptionA() super()
    ExceptionA(String msg) super(msg)
    In my client program i have
    catch(Exception A)
    System.out.println(A.getMessage());
    but this method does not seem to work
    because it will return java.lang.methodnotfoundexception
    it seems to complain that ExceptionA(String )
    not found
    thanks for your help
    null

    Hi,
    BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( )
    The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( )
    Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( )
    The BAPI Add<subobject> adds a subobject to an existing object instance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Reward if helpful.
    Regards,
    Harini.S

  • Hi My Iphone 4 keeps on turning off with no reason and there is no way of turning it on. any advice of how to get it working?

    Hi My Iphone 4 keeps on turning off with no reason and there is no way of turning it on. any advice of how to get it working?

    I guess but that was what I was on earlier but it wasn't of much help.
    I need to chat with an apple person but don't know how if I don't have a phone accessible.
    Is there a way to connect thru a laptop or something?

  • ITunes keeps takeing unauthorized withdraws from my bank account for no reason i have made no purchases so they have no reason to be takeing money out of my checking account.  can someone tell me how to get my 100$ back.cant fig out how to email them

    ITunes keeps takeing unauthorized withdraws from my bank account.  I have tried to figure out how to get my money back from the 4 unauthorized withdraws to my account. I cant figure out how to get there email address or how to initiate a live chat with them and there website has been no help to me.  Can someone please tell me how I can get my money back
         Thank you

    you need to call apple support. All contact methods are listed here. http://support.apple.com/kb/HE57 good luck
    I Hope I Was Able To Help You Or Solve Your Question.
    Simmm
    3/12/2012
    <Edited by Host>

Maybe you are looking for