API Error Handling

I want to create store procedure that reads datas from text file and using API to create the record in database. I've try to write the simple code by follow the code example in "Oracle Order Management Suit API and Open Interface". I have the following questions.
1.) How can I know which record cause me an error when the error was detect after calling API (API was called only one time to avoid the performance problem)?
Ex.
for k in 1 .. x_msg_count loop
gpr_msg_data := oe_msg_pub.get( p_msg_index => k,p_encoded => 'F');
dbms_output.put_line('err msg ' || k || ' is: ' || gpr_msg_data);
end loop;
2.) Can I get the error code for each error message?
3.) What are the different between oe_msg_pub.get(...) and fnd_msg_pub.get(...)?
4.) How can I know which package (oe_msg_pub/fnd_msg_pub) I have to use to get the error message?
Thank you very much
Sunti

Hi Sunti,
I have a similar requirement, can you let me know if you were able to find the solution.
Thanks,
Nagesh Manda.

Similar Messages

  • Bursting with JAVA APIs / MultiThreading / Errors Handling

    We are trying to use the bursting JAVA APIs 10.1.3.3.1 Standalone) to burst huge XML files and generate PDF Files from RTF templates. Here are a list of our issues with this feature:
    1. We have some problems catching the errors when bursting. We have tried to use the "oracle.apps.xdo.common.log.Logger" class, but it is not always reacting like we think it should. Could you please give us an exemple of a clean bursting error catching or a brief description of how we could do it. We have a lot of difficulties to find information about using the JAVA APIs of BIP.
    2. Is it a clean way of catching the bursting errors to use the "oracle.apps.xdo.common.log.Logger" class?
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?

    1. Check tim d. blog, you can use the bursting listners to get the errors. It's also in the documentation.
    First, on every exception, the Bursting APIs are dumping the error in the Logger. So I can't see how we can use the listeners to catch these. We can check the hasExceptions on the Logger but still, we have some problems with this. When we deploy our application as a MDB (Message driven bean), it seems that once the hasException flag has been raised, if we call the MDB again, it is still up. Is there documentation about that Logger class? Also, I'm worried that we won't be able to call our MDB twice to run simultaneously 2 different bursting process since it seems the Logger is something static, keeping every exception in memory... That's bad.. And show me where you have found documentation about this. All I see in documentation is how to call the DocumentProcessor in a couple of lines. I don't see anything about a clean way to catch errors.
    2. Yes/No/Depends. I think it's fine. If your changing the logger options in your program that could come back to haunt you.
    I guess so, I'm not changing anything and its already haunting me...
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    Even worst, when we deploy the component has an MDB, when the error happens, it kills the whole oc4j container... please correct this quick.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?
    We got an answer from the dev team which is to add two properties to the document processor, something like:
    enable-multithreading: true
    thread-count: >2
    We did that and what we got is that the process started and it got stuck in a dead lock at the first document processing. How nice! :)
    We got a milestone in March and I'm really worried about all those problems... Not enough documentation, a pretty bad error handling, errors making crash the whole oc4j container, Logger seems not to be handling simultaneous calls/ threads, not even handling two subsequent calls... etc.
    If anyone has the magic answer, it would be pretty welcomed!
    Thanks

  • Error Handling with JPA

    I'm working on a JPA/TopLink Essentials/ADF faces application. It's going well except that I don't have a clue how to get on top of the error handling. JPA doesn't seem to have any. I would assume that there must be a Toplink extension[b] to find out what errors/codes etc are being produced. ADF faces does a ok job of showing them on screen but the handling should be more user friendly for errors like invalid foreign key, unique key violation etc.
    Since there is no return and no exceptions declared on JPA functions like persist(), I assume that there must be some sort of listener that I can register to handle the errors myself. If ADF Faces can get the errors then so can I, but how??
    Any help would be appreciated
    Mark

    The "errors" raised by the persistence provider for the types of "errors" you mentioned are all runtime exceptions of the PersistenceException variety. See the javadoc for this class and also look at its subclasses: http://java.sun.com/javaee/5/docs/api/javax/persistence/PersistenceException.html
    Since PersistenceException is an unchecked runtime exception, its up to you to catch it at whatever point you decide to handle these types of problems in your application (i.e. in the service layer which would communicate the problem to your view layer to display something user friendly). Make sense?

  • Can error handling framework use fault policies and BPEL catch blocks

    As part of an integrated customer solution that makes substantial use of SOA Suite (including OSB, BPEL, Mediator, etc) we are in the process of designing an “Error Hospital” subsystem to expose a web service API specifically for BPEL services and/or the OSB layer to call whenever they encounter an exception which they cannot handle so that the appropriate user is notified of the error (via email) and the error is recorded (in an appropriate common fault format, with error codes elaborated into more meaningful descriptions, etc) within OEM, immediately prior to returning the exception to the caller.
    The problem we have experienced in our design is as follows:
    •     We have an error handling service to be called, inside the BPEL catch blocks, when an error occurs to notify the appropriate user, via email, that an error has occurred;
    •     We also use the error handling XML fault-policies so that we can recover from an error using OEM (via human intervention);
    •     The error service needs to be called before the process is suspended (waiting for human intervention) so the email notification and error message formatting occurs BEFORE the recovery action. Unfortunately the fault policies trigger BEFORE the error handler is able to transform the error into the appropriate format and notify the user so the error recorded is not the reformatted one and the user is never notified.
    The key question is how can a BPEL, upon catching an exception, invoke the error handling service and AFTER that send the error to OEM (and have the process suspended).
    It seems the two mechanisms "cannot play nicely together"

    As part of an integrated customer solution that makes substantial use of SOA Suite (including OSB, BPEL, Mediator, etc) we are in the process of designing an “Error Hospital” subsystem to expose a web service API specifically for BPEL services and/or the OSB layer to call whenever they encounter an exception which they cannot handle so that the appropriate user is notified of the error (via email) and the error is recorded (in an appropriate common fault format, with error codes elaborated into more meaningful descriptions, etc) within OEM, immediately prior to returning the exception to the caller.
    The problem we have experienced in our design is as follows:
    •     We have an error handling service to be called, inside the BPEL catch blocks, when an error occurs to notify the appropriate user, via email, that an error has occurred;
    •     We also use the error handling XML fault-policies so that we can recover from an error using OEM (via human intervention);
    •     The error service needs to be called before the process is suspended (waiting for human intervention) so the email notification and error message formatting occurs BEFORE the recovery action. Unfortunately the fault policies trigger BEFORE the error handler is able to transform the error into the appropriate format and notify the user so the error recorded is not the reformatted one and the user is never notified.
    The key question is how can a BPEL, upon catching an exception, invoke the error handling service and AFTER that send the error to OEM (and have the process suspended).
    It seems the two mechanisms "cannot play nicely together"

  • Using code interface node with dll crashes LV 2011 but not LV 8.6... using max error handling does nothing

    Hi all,
    I'm having a peculiar problem.
    I inherited a project saved in LabVIEW 8.6. The project must use of particular dll that was built a few years ago. The original developer and source code for this .dll are long gone. The very core logic exists, in the form of embedded C code, and that's it. The .dll is called through a Code Interface Node in LV 8.6 and this setup manages to "work". Howver, running the VI that calls this .dll in LV 2011 causes an "insta crash", as in, no "program has stopped responding".  Error message pops up, then all LV windows close.
    It's very similar to that described in here:
    http://digital.ni.com/public.nsf/allkb/D84C9775ABD921CF8625772A005CA50C
    but this KB says to try putting the amount of error handling to maximum. I tried that, but it didn't help. 
    Using the "Debug" option allows me to run the just-in-time debugger with CVI 2010, which then proceeds to say this:
    Finally, I manage to get this out of it: 
    FATAL RUN-TIME ERROR:   Unknown source position, thread id 0x000012D4:   A non-debuggable thread caused a 'General Protection' fault at address 0x00000000.
    I don't think that really helps at all, but it's there.
    Here is the function prototype of the .dll:
    void  _inputPM@224(uint8_t arg1, uint16_t arg2, uint8_t arg3, float arg4, float arg5, float arg6, float arg7, float arg8, float arg9, float arg10, float arg11, float arg12, float arg13, float arg14, float arg15, float arg16, float arg17, uint16_t arg18, uint16_t arg19, uint16_t arg20, uint16_t arg21, uint16_t arg22, uint16_t arg23, uint16_t arg24, uint16_t arg25, uint16_t arg26, float arg27, float arg28, float arg29, float arg30, float arg31, float arg32, float arg33, float arg34, float arg35, float arg36, float arg37, float arg38, float arg39, float arg40, float arg41, float arg42, float arg43, float arg44, float arg45, float arg46, float arg47, uint16_t arg48, uint16_t arg49, uint16_t arg50, uint16_t arg51, uint16_t arg52, float arg53, float arg54, float arg55, float arg56);
    (never seen a function take 50 input params like that (wouldn't you use a struct? array? something? But I digress, and I don't know anything about .dlls...))  
    I do have a ".lib" and a ".cdb" file with the same name as the .dll, but those also looks like some kind of compiled file. 
    I'm sure the answer I'm going to get is that there is no way of telling what's really going on without .dll source code. I'm hoping against hope that there may be another way or hack.
    Any ideas? Thank you for you help. 
    Regards,
    Mark G 
    Solved!
    Go to Solution.

    MarkCG wrote:
    Changing the call library node to stdcall (WINAPI) did the trick! No more crash. Thank you very much!
    I haven't run LV2011 on windows XP, only on windows 7, so I don't know if that makes a dfference. But  The call type makes no difference when using LV 8.6 on the same machine, however.
    Now I've got to make the .DLL run corretly on a compact fieldpoint....  and avoid crashing IT. 
    Thank you for the help all!
    Well, the DLL did work fine in LabVIEW 8.6 because earlier versions of LabVIEW automatically proceeded to change the calling convention to stdcall, if they noticed a function name decoration of @# (# = number of bytes passed on the stack) appended to the name. This is the default naming decoration for stdcall functions used by VisualC. However this decoration can be overwritten with linker switches, other compilers don't use them always in the same way, and most likely there are in the mean time compilers out there that can produce such decorations also for non stdcall calling convention. So this automagic trickery was removed from newer LabVIEW versions.
    I do think it could be considered a bug in the code that upgrades LabVIEW VIs, that it uses the calling convention that is configuerd in the dialog, instead of the calling convention earlier LabVIEW versions used automagically, but it is an esoteric corner case.
    What Compact Fieldpoint controller do you have? If it's anything newer than 20xx or 21xx forget it. The 22xx controllers use a PPC CPU and VxWorks operating system and can never get a Windows DLL to operate properly. If it is a 20xx controller it's still highly likely that DLL can not even get loaded into LabVIEW as it likely relies on other runtime libraries and possibly Win32 APIs not present in the Pharlap ETS runtime kernel used on those controllers.
    There is a tool to check a DLL for incompatible imports that are not present on specific ETS RT systems. And this list summarizes the RT system used on the various NI controllers.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Error handling in the InDesign SDK

    I've almost reached the first milestone on my InDesign project and before I move on I decided to do a code review. One thing that caught my attention are the InDesign smart pointers and how they are used in the SDK samples and some of the open source stuff.
    For example, here is some code from AppearancePlaceBehaviourUI.cpp in function GetCursor().
    InterfacePtr<IHierarchy>     sourceItem(const_cast<AppearancePlaceBehaviorUI*>(this), UseDefaultIID());
    InterfacePtr<IHierarchy>     parentItem(sourceItem->QueryParent());
    InterfacePtr<IPlaceBehavior> parentBehavior(parentItem, UseDefaultIID());
    if (parentBehavior == nil)
        InterfacePtr<IHierarchy> sourceContent(sourceItem->GetChildCount() ? sourceItem->QueryChild(0) : nil);
        if (sourceContent)
            InterfacePtr<IPlaceBehaviorUI> sourceBehaviorUI(sourceContent, UseDefaultIID());
            cursor = sourceBehaviorUI->GetCursor(globalLocation, modifiers);
    Although the code works under normal circumstances, it strikes me as unsafe code.
    sourceItem->QueryParent() is called without first checking that sourceItem is not a NULL pointer.
    Functions of the sourceItem object are used again (GetChildCount() and QueryChild()).
    The pointer sourceContent is checked before passing it to the constructor of sourceContent.
    Function GetCursor() is called without checking if sourceBehaviourUI is not NULL.
    For code tidiness pointers should really be tested against nil (i.e. if (ptrSomeObject != nil))
    It strikes me as being inconsistent and easy to break - unless that is some of these interfaces are guaranteed to return pointers, in which case is there documentation to state as much? What would happen in the case of an exception such as bad_alloc - are they guaranteed not to throw?
    I know that in some places (but not all), the samples use an "exception-style" approach of placing code blocks within a "do while(kFalse)" statement. They check for a NULL pointer and if they find one, break out of the "loop". This approach avoids deep nesting code.
    It would be great if Adobe gave a statement stating what their code base will do and won't do (i.e. exception safety). A few definative error handling examples for developers wouldn't go amiss either.

    Hi Dirk,
    Agreed - I also would like to see more real world source code that explains concepts. It would be good to see samples geared towards operations on a very small set of types (i.e. Libraries, Library Commands) with tutorials explaining what the sample is trying to demonstrate. For example:
    Library sample demostrates:
    How to open a library.
    How to close a library.
    How to add items via approach A.
    How to add items via approach B.
    How to remove an item from a library.
    How to remove an item from a library based on a specific criteria.
    How to remove all items from a library.
    Such samples would also demonstrate Adobe's idea of best practice - consistent code style, comments and error handling.
    As Helmut25 posts in his thread "Tutorial for plug-in programming?" it would be good to see more step by step tutorials that don't just do a copy and paste but also explain clearly what is being done and why. You want to get into an Adobe developers head, understand their view of the universe and then apply what you've learned in your own projects.
    Back onto error handling...
    I've spent many a year doing Win32 programming (via C-style API, not MFC), so I'm used to using GetLastError() to find out why a function failed. Never really had reason to use SetLastError() and by and large avoided it. I think any API has to state what will happen when things go wrong (Microsoft's Win32 documentation is very good at this) and consequently you know how to write your code to account for such things.
    One thing I like to do on standalone Win32/C/C++ applications is use a tool called AppVerifier, which allows you to throw various spanners into the works and see how your application copes. Shame there isn't something similar for testing plug-ins. I like to think that if InDesign crashes, it's not down to my code.
    Regards,
    APMABC

  • Error handling strategy

    It seems that many functions in the SDK have underdocumented return codes in error situations. For example, take LrFileUtils.createAllDirectories(). The documentation says:
    Return value: (Boolean) True if any parent directory was created; false if all parents already existed.
    Ok, possibly useful info, but is there a value that says whether the directory creation itself succeeded or failed? I've pored over the doc and by now I don't think I've missed anything. There are plenty of other functions that don't seem clear in that regard. How are other developers doing error handling?

    Eric, good point. Although I only threw out that one function as an example. If I want something robust right now, it seems I'll want to write wrapper functions for many APIs that do this. For instance, copy() and move() as well.
    You say "in the meantime". Can you clarify: does that mean that the APIs actually don't return error codes/messages or that they do but simply aren't documented completely?

  • Break execution after custom run-time error handler callback

    I am using Teststand 2010 SP1 and have written a custom runtime error handler based on the ErrorHandlerExample example that ships with TestStand. It has been implemented as a StationPostStepRuntimeError callback in my Station Callbacks folder.  I have modified the example as follows:
    (1) Added code to turn off the UUT transmitter if it was on.
    (2) Added a call to an executable that sends an email to the currently logged in user.
    (3) Calls the standard TestStand run-time error dialog using the Engine DisplayRunTimeErrorDialog method.
    (4) Processes the user's selection, then turns on the UUT transmitter for any option other then Abort.
    The callback also checks the status of the Break and "Don't Show again for this execution" options selected by the user.  If the user selects Break then the only option I can find is to call the API Execution.Break() method which breaks the execution right there in my callback. The user then has to single step there way out of the callback.   Is there a way of instructing TestStand to complete the callback execution and break immediately after completing the callback (i.e.at the step following the error)?  I've zipped up and attached my modified sequence.
    Alternatively, is there a better way of doing this?
    Regards,
    David
    Solved!
    Go to Solution.
    Attachments:
    StationCallbacks.7z ‏13 KB

    Didn't have a chance to try it yet but maybe StepOut is your solution?
    From the TS Help:
    StepOut Method
    Syntax
    Execution.StepOut
    Purpose
    Resumes the execution from a suspended state and then suspends the execution again after execution of the current sequence completes.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Best error handling for visa calls?

    We are using some handlers we've devloped for power supply handling (over GPIB). The power supplies are SCPI and use SCPI/GPIB commands. The handlers use the NI visa api's Read() and Write() functions to send the commands.  They work fine, for the most part, and we've been using them for a number of years.
    However, we're hearing reports that there may have been a few times that commands were not executed on the power supply and our handler did not report back any error.
    So, I'm trying to update these handlers to add a little error checking to make them more robust and hopefully we'll catch this error if it happens again.
    For error handling, I've come up with 3 solutions and tried all 3. I find some benefits and drawbacks with each and hoped I could get your opinions about error handling as I'm not overly familiar with some of the methods.
    Method 1:
    Set the Event Status Enable register to catch all events (or all that I care about).
    Read status byte (STB?) after each command and check the event bit and then event status bit if event bit set.
    Drawback1: I have one power supply that does not implement this correctly and a second type that appears to not be working correctly either.
    Drawback2: Errors are generic. I'll know if I got, for example, a DDE (Device Dependant Error), but I won't know more detail than that.
    Method 2:
     After each command sent, read the error queue with the System:Error? query.
    Drawback: It seems I get a lot of messages back in this method that aren't real errors. It's very "noisy" and I have no way to distinguish real errors from "noise" messages like "query interrupted" and such.
    Method 3:
    Check the return code of the Visa Read() and Write() commands. At first I didn't think this was very robust, but after seeing the list of errors here, I'm beginning to think that these might be more robust and detailed than Method 1. However, I'm not sure.
    So is method 3 as robust as it looks, or is there a combination/comprimise I can make, or another method I did not mention which is best to trap errors from Visa Reads/Writes to these GPIB power supplies? Keep in mind that the handlers work for a number of different power supplies and its likely that some things may be implemented differently between supplies....so its best to stick with somethind standard that will work on all power supplies.

    Hi KingTermite,
    I hope you will got answer of the question and may be implemeted something .It was really a nice discussion .I am also facing the same issue where I am communicating with different instrument using  GPIB communication and RS 232 too.
    Can you share and discuss about the implementation of your initiative.
    Best Regards
    Regards:
    Vaibhav Kanchan
    Sr. Engineer
    NI Certified LabVIEW Developer(CLD)
    NI Certified TestStand Developer(CTD}

  • Getting sequence filename and sequence name in process model error handler

    We are using the sequential process model and would like to log sequence step error information to a file.  We have an Error Handler callback in SequentialModel.seq and that is where we will write to the error file.  In the Error Handler callback, I can get the error container info for the step where the error occurs and the name of the that step thru the Error Handler Step parameter.  I would also like to record the sequence file and the sequence where the error occurred, but I have not been able to find those in the sequence context.  I know they are available because the TestStand RunTime Error dialog box displays them.  How can I access the name of the sequence file and the name of the sequence where the error occurred?
    Thanks,
    Hans

    Hey hans,
    Use the API.  Since you already have the Step object reference coming in as a parameter you can just use a few ActiveX steps to get the Sequence File and Sequence from which the error was thrown.
    Step.Sequence
    Sequence.Name (gets the name of the sequence)
    Sequence.SequenceFile
    SequenceFile.Path (gets the path of the sequence file)
    So basically just 4 activex steps.  I hope this helps.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • ADF11g+ Custom error handler

    Hello,
    I am using Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    I defined the custom error handler as mentioned in the ADF development guide.Facing weired issue when AM method is called from task flow.
    e.g,
    AM method
    public showSuccessMessage(){
    this.getDBTransaction().addWarning(new JboWarning("Hello Sample message from AM"));
    Above method is called from taskflow and corresponding action is specified in the page.I have task flow ErrorHander activity defined for the task flow also.When I click the button to call the AM method,Jbo warning raised in AM and catched by the task flow error handler and after this control is passed to CustomErrorHandler and message shows properly.But this happens only first time.After that control never goes to custom error handler. Am I missing some thing??
    Any idea why??
    Thanks
    RB

    Hi Frank,
    Thanks
    What I noticed is,
    Case:1
    when warning is raised using the addWarning api from AM, binding layer throws exception of type Warning,catches in task flow error handler and directly goes to get getDisplay message method of the custom error handler which is defined in databinding.cpx only once.After that it catches in taskflow error handler and never goes to custom error handler defined in data binding.cpx
    Case2:
    When I raised it as throw new JboException flow goes reportException of custom error handler and which calls the getDisplay message.In this it even not going to task flow error handler.
    If you can confirm this is expected behavior or it is bug that would be great,it helps us define the exception handling framework.
    Thanks
    RB

  • WebRTC's CreateOffer appears to have broken the error handling

    I had a working implementation of WebRTC, using the Adapter.js pollyfill. It was previously working between Firefox and Chrome but now it appears to have a type error on the error handler. I had it set to use null, which still works in Chrome but Firefox now requires {} for an empty error handler (therefore breaking either Chrome or Firefox depending which I use). And it doesn't seem to work with an actual error handler either!
    Example Code:
    // Works in Firefox
    pc.createOffer(function(description) {
    console.log(description);
    pc.setLocalDescription(description);
    socket.emit('received_offer', JSON.stringify(description));
    }, {}, mediaConstraints);
    // Works in Chrome
    pc.createOffer(function(description) {
    console.log(description);
    pc.setLocalDescription(description);
    socket.emit('received_offer', JSON.stringify(description));
    }, null, mediaConstraints);

    A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the mozillaZine forum site in order to post at that forum.
    See also:
    *https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC
    *https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/WebRTC_basics

  • Custom Error Handling

    Hello,
    I would like to create a custom error handler in a model file similar to the ErrorHandlerExample.seq.
    In my case, I will be handing errors genereated in several different dlls.  We are trying to avoid writing wrappers around the dll functions to fill in the TestStand error strings.  However, this information is available by calling a "get error message" function in the dll.  Since I have more than one dll and more than one handle that I will need to check the errors for, I need to know the information about the step that caused the error.  Is there a way to get more information about the step that caused the error?  I might have a dll function call that had the format: 
    kiOpenVSA(StationGlobals.KiManager, StationGlobals.VsaSession, StationGlobals.VsaResourceString, StationGlobals.DisplayEnable, StationGlobals.SendInitCommands)
    Based on the parameters of the function call, I would be able to call the correct error handling function.
    Thanks,
    Mike
    Solved!
    Go to Solution.

    Hi Mike,
    If you want to pragmatically get the name of the DLL file, DLL function and parameters that were called in a previous step, you will first need to reference the step in which the DLL call was made and use the following TestStand API.
    Assuming that the DLL was called in the previous step you can use the following expressions using TestStand 4.1.
    Access the dll function expression
    RunState.PreviousStep.Module.CommonCModule.FunctionCall
    Access the dll function name
    RunState.PreviousStep.Module.CommonCModule.FunctionName 
      Access the parameters
    RunState.PreviousStep.Module.AsDllModule.Parameters.item(index)
    Note that if you are using an older version of TesStand, these functions may not work and you may have to use the ActiveX/COM steps to access this information.
    I hope this helps.  
    Message Edited by S_Hong on 02-10-2009 05:02 PM
    Message Edited by S_Hong on 02-10-2009 05:07 PM
    S_Hong
    National Instruments
    Applications Engineer

  • Writing an error handler package

    I want to standardize on an error handling package, with a record type declared that is anchored to a table. Some obvious attributes I can think of for the table are the following:
    1. Time stamp
    2. The package that threw the error
    3. The method that threw the error
    4. Any textual content written by the programmer that invoked the package. Perhaps that could be a concatenation of relevant fields with a delimiter for example.
    5. The severity of the error. For example, it could be 'fatal' i.e. can't move any more, 'severe' i.e. threw out junk but leaves the result table with too little content to be practical etc.
    6. The author who wrote the code.
    My questions are:
    (i) In the experience of seasoned writers of libraries in this forum, are there other significant fields (and enumerated values of error types) that you capture, independent of the domain that you are writing this for?
    (ii) Is there an analog of argv[0] of the C language in PL/SQL that provides the package (and method)? names? this way, I can proof against the careless programmer mis-typing.
    (iii) Apart from writing to the db table and perhaps sending e-mail, are there any significant methods to this package that have escaped my admittedly cursory analysis?
    (iv) I am thinking of making it refuse to accept null values for the fields which would force the invoker to populate them when he or she throws an exception. Are there any other things I should force?
    Thanks,
    Srini

    Firstly this is not "error handling" it is logging. They are two different things.
    Secondly, before you go any further down this road I recommend you check out log4plsql. This does quite a lot of what you want and a whole lot more besides. It is not perfect (I discuss some of its shortcomings here but it is a very good starting point.
    Some specifics:
    6. The author who wrote the code.If you know the PACKAGE/METHOD names and you know the version of the software deployed in that environment surely your software version control software will tell you this info?
    ii) Is there an analog of argv[0] of the C language in PL/SQL that provides the package (and method)? names?No. Unfortunately PL/SQL lacks this sort of refection, it would be very useful. One tactic is to expand the logging to include INFO and DEBUG levels, which can be turned off (log4plsql does this). Then the developer gets some benefit from the logging package and that is an incentive to get the names right. Another approach is to use an IDE (such as TextPad) that supports clip libraries; include your logger registration call in the templates for PACKAGE, PROCEDURE and FUNCTION.
    (iii) Apart from writing to the db table and perhaps sending e-mail, are there any significant methods to this package that have escaped my admittedly cursory analysis?Syslog. It is then industry standard. Some people like files.
    (iv) I am thinking of making it refuse to accept null values for the fields which would force the invoker to populate themI think it is an important principle that logging should be as robust as possible - we don't want a gnarly exception thrown because the logging package failed to handle a trivial issue.
    You will get the maximum uptake of your logging package if its API is easy to use and developers can see ready benefits from making it work. Again, DEBUG is the key here: all you need do is make it easier to use your package than typing (and removing!) DBMS_OUTPUT.PUT_LINE calls.
    Cheers, APC

  • Unable to achieve Error Handling

    Hi All,
    Within my method call I invoke a error handler method but this does not seem to function. The code is as enclosed below can someone let me know as to why please.
      public void onActionContactPersonalizationPressed(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionContactPersonalizationPressed(ServerEvent)
         this.checkMandatory("ProductCategory");     
         this.checkMandatory("ProductFamilySel");
         this.checkMandatory("ProductSel");
         this.checkMandatory("ContractManager");
         this.checkMandatory("ContractStartDate");
         wdThis.wdGetAPI().getComponent().getMessageManager().raisePendingException();
         wdThis.wdFirePlugExitCustPOCtoCP();
        //@@end
    // Error handler method
      public void checkMandatory( java.lang.String fieldName )
        //@@begin checkMandatory()
        IWDMessageManager msgMgr = this.wdThis.wdGetAPI().getComponent().getMessageManager();
        Object attVal = this.wdContext.currentContextElement().getAttributeValue(fieldName);
        IWDAttributeInfo attInfo = this.wdContext.getNodeInfo().getAttribute(fieldName);
        if(attVal instanceof String){
             if(((String)attVal).length() == 0){
                  msgMgr.reportContextAttributeMessage(
                  this.wdContext.currentContextElement(),
                  attInfo,
                  IMessageHPBBankingProductOffering.MISSING_INPUT,
                  new Object[] {fieldName},
                  true);
        //@@end
    Thanks in advance.
    Best regards,
    Divya

    Hi All,
    I have now changed it to the code enclosed below:
      public void onActionContactPersonalizationPressed(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionContactPersonalizationPressed(ServerEvent)
         this.checkMandatory("ProductCategory");     
         this.checkMandatory("ProductFamilySel");
         this.checkMandatory("ProductSel");
         this.checkMandatory("ContractManager");
         this.checkMandatory("ContractStartDate");
         String selPdDesc = (String)wdContext.currentContextElement().getAttributeValue("ProductSel");
         wdContext.currentContextElement().setProductSelDesc(selPdDesc);     
         if( !wdThis.wdGetAPI().getComponent().getMessageManager().hasExceptions() ){
         wdThis.wdFirePlugExitCustPOCtoCP();
        //@@end
      public void checkMandatory( java.lang.String fieldName )
        //@@begin checkMandatory()
        IWDMessageManager msgMgr = this.wdThis.wdGetAPI().getComponent().getMessageManager();
        Object attVal = this.wdContext.currentContextElement().getAttributeValue(fieldName);
        IWDAttributeInfo attInfo = this.wdContext.getNodeInfo().getAttribute(fieldName);
        if(attVal instanceof String){
             if(((String)attVal).length() == 0){
                  msgMgr.reportContextAttributeMessage(
                  this.wdContext.currentContextElement(),
                  attInfo,
                  IMessageHPBBankingProductOffering.MISSING_INPUT,
                  new Object[] {fieldName},
                  false);
        //@@end
    Still doesn seem to work.
    Can someone state as to why?
    Thanks in advance
    Best regards,
    Divya

Maybe you are looking for

  • Calling IP function in ABAP report

    Hi guys, I would like to execute a planning function of BIIP from an ABAP report. Which function module has to be used or is there a different approach? For the old BPS planning function there was the API_SEM_BPS.... Regards Stefan

  • How to enable the Pages's endnote citation ? Thanks

    I just installed the Pages's endnote plugin and I still cannot see the function on menu bar activated.Pages version 5.5.2, Endnote plugin version 2.0.  Anyone who can help ? Thank you !

  • Read dBase V (.dbf) files from Oracle

    Can I use the HTMLDB or other component within the Oracle to select records from dBase V?-

  • Dreamweaver crashes on startup - check the Common folder

    CS3 build3841 and OSX 10.5.8 I tried deleting Dreamweaver sitecache and configuration folder, but nothing worked.  I noticed a folder named "9" in the Common folder here: /Users/[username]/Library/Application Support/Adobe/Common/9 I renamed it to "9

  • Printing multiple hidden JPanels using Book and Pageable

    I am trying to print a number (in some cases a large number) of JPanels that reside in a Vector; they are only visible one-at-a-time but need to be printed all together. When printing if I am viewing the first page the first page is printed. If viewi