Best Practises for Error Handling

Hello
I have a PHP front end application and for now an Oracle database in the backend. User defined errors are returned back to PHP front end using RAISE_APPLICATION_ERROR(-20000,'error msg'), the PHP displays the message to the user. We have a problem where we are now going to provide a French version on the application and are stuck at what we are to do with the error messages.
What is the common practise for this?

Don't reinvent the wheel. Oracle provides built-in error globalization.
http://www.morganslibrary.org/reference/pkgs/utl_lms.html
SQL> set serveroutput on
SQL> DECLARE
  2   s VARCHAR2(32767);
  3   i PLS_INTEGER;
  4  BEGIN
  5    i := utl_lms.get_message(26052,'rdbms','ora','french', s);
  6 
  7    dbms_output.put_line('before format, message is: ' || s);
  8 
  9    dbms_output.put_line('formatted message is: '|| utl_lms.format_message(s, 96, 'my_string'));
10  END;
11  /
before format, message is: Type %d non pris en charge pour l'expression SQL sur la colonne %s.
formatted message is: Type 96 non pris en charge pour l'expression SQL sur la colonne my_string.
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
  1  DECLARE
  2   s VARCHAR2(32767);
  3   i PLS_INTEGER;
  4  BEGIN
  5    i := utl_lms.get_message(26052,'rdbms','ora','german', s);
  6    dbms_output.put_line('before format, message is: ' || s);
  7    dbms_output.put_line('formatted message is: '|| utl_lms.format_message(s, 96, 'my_string'));
  8* END;
  9  /
before format, message is: Nicht unterstützter Typ %d für SQL-Ausdruck in Spalte %s.
formatted message is: Nicht unterstützter Typ 96 für SQL-Ausdruck in Spalte my_string.
PL/SQL procedure successfully completed.If you are writing your own messages then Tubby's recommendation is best but I'd be inclined not to put the messages into a table but rather to put them into a package header as constants which minimizes I/O overhead.

Similar Messages

  • What is Considered Best Practice for Error Handling in Components?

    What would be the best approach to handling errors in custom (possibly composite) components?
    I see three different possibilities:
    Having the error handling funciton within the component. The problem is that this is not adaptable to the consumers error handling setup (i.e. logging to database, redirecting to a pretty error screen, etc.).
    Passing in an error function as a parameter. The problem here is how to have the externally defined error function interact with external elements that are not defined within the component, i.e. passing the error or fault object to a logging class, or something similar, of which the component knows nothing about.
    Referencing the external error handling methods directly from within the component. (Of course that's shabby programming, just listing as a technical option.)
    How do you solve this?
    My goal is to have a versatile custom component that can utilize any given consumer's error handler.
    Thanks,
    Mike

    or define a customized event and dispatch it when error occur, then you can just listen to it outside

  • Best Practise for connecting to Ethernet based device

    Hi,
    I have inherited a system where we have a cDAQ-9181 controlling an vehicle access barrier, with a LabView application on  a PC talking to it via Ethernet.
    (The application is very simple - press a button > send a value to the 9181 unit > opens the barrier )
    All works fine most of the time.
    ( We occasionally get network related errors. The LabView application sometimes thinks another PC has reserved the unit, or gives “error 89130 - device not available for routing” )
    The users would now like to be able to easily run the application from a second PC ( not at the same time ), but this seems to be a problem. If I exit the application on PC “A” and run it on PC “B” it struggles to reserve the chassis, and throws the “89130” error and I have to restart the unit via MAC.
    While I’m a “veteran” control programmer, I’m new to LabView, and would be very grateful for any pointers on “best practise” for talking to devices via Ethernet, or any specific suggestions for handling multiple PCs talking to a single device.
    Thank You.
    Tim.

    Hi Tim,
    Thank you for your post and welcome to the NI forums.
    There are lots of knowledgebase articles on our website and you should be able to find documentation for most of our hardware.
    There is a good troubleshooting guide for cDAQ Ethernet here (http://ae.natinst.com/public.nsf/web/searchinternal/e67b4e4749f378ff862577270059bd4b?OpenDocument) - it outlines the steps to take to ensure you have a stable a connection as possible. You may have already seen it, but the quick-start guide for your specific device may also be worth consulting for best practices. Are these helpful?
    As for using more than one PC - this shouldn't be too much of an issue. I would expect that the resource isn't being closed correctly - when you exit the App on PC 'A', how are you closing off the resource?
    Best regards,
    Eden S
    Applications Engineer
    National Instruments UK & Ireland

  • What is the best practise for setting dirty flag of a page/view?

    For a page/view, normaylly there are 2 things to do for diry data:
    1. when it's clean, Save button is disabled, when it's dirty, save button is enabled.
    2. when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".
    My thought is: it must be handled at client side, because not all valuechange is auto submitted. E.g., you type the 1st letter of a string in a input box, the server side does not know it, but save button should be enabled immediately.
    Is it possible to capture all valueChange events in a page or a view at client side?
    I'm not sure what is the best practise for setting dirty flag? If there is better solution? Does ADF provide facility for this?

    public void save(ActionEvent event){
    boolean formValid = isFormValid();
       if (formValid) {
      save button is enabled.
        private boolean isFormValid() {
            boolean valid = true;
            if (Check Condition 1) {
                valid = false;
               showErrorMessage1();
            if (Check Condition 2) {
                valid = false;
               showErrorMessage1();
            return valid;
        private void showErrorMessage1() {
                    when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".

  • ECC 6.0 upgrade to  Best practise for chemical industry implementation

    Dear All.,
    Please tell me what all the  EHP3 must be updated in the SAP erp ecc 6.0. I have already updated
    SAP_APPL 60304.
    Tell me what is the next Ehp3 required before i start best practise in saint.
    Thanks & Regards,
    Manju

    Dear sir.,
    I have  installed SAP ECC 6.0 for a chemical industry, now am planning to implement Best practise to reduce implementation time.
    1) As per the SAP Quick quide i have downloaded best practise for chemical industry(IS) and implemented through SAINT,  and the prerequisites were maintained as per the SAP notes 774615,1301301,1064635,
    2)The above mentioned notes explains minimum stack11 and sapka=18,sapkb=18,sapbw=20,PI_Basis-2005_1_700=20 and sap_ap=15 to update Ehp3 for SAP_APPL603.
    3) After updating all the above mentioned patch level i implemented the Best practise in saint and that was successful.
    But still  the problem persist in activation of BP by tcode /n/smb/bbi only 70% has been completed and activation stoped with *ABAP program error ASSIGNSUBSTRING_NOT_ALLOWED and relevent note is 1295083*_
    Please  any one tell me, is that required to update all the EHP3 components since i have maintained only SAP_APPL60304.
    What all Ehp3 components should be updated to get a smooth activation og BP for chemical industry.

  • BPM for error handling and acknowledgements

    Hi,
    Can any one tell me how to handle BPM for error handling and acknowledgements in one scenario.
    Please send me the link if you have other wise give me the solution on the same.
    Thanks,
    Nagesh

    Hi !
    Just check out these links This might help you.
    Usually Application Level Acknowledgement is considered during Sync communication. If you are using RFC, you can make use of Sync communication. So you can handle it without bpm, provided your both sender and receiver are sync interfaces.
    To know about Ack-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm
    you can not dirrectly access the content of the ACK, however the BPM shows different behaviours based on the ACK status. E.g. if the ACK contains a success message the BPM will continue in its normal process, if the ACK contains a permanent error, it will either stop or go through an exception branch (provided such a branch has been defined). Have a look at the documentation: http://help.sap.com/saphelp_nw04/helpdata/en/43/65ce41ae343e2be10000000a1553f6/content.htm It doesnt"t state the above mentioned behaviour in detail but says that you need to define an exception branch.
    The trickiest part is always to find out, when you will get a transient vs. as permanent error ack. If you are using ACKs with Proxies refer also to this link http://help.sap.com/saphelp_nw04/helpdata/en/29/345d3b7c32a527e10000000a114084/content.htm and this http://help.sap.com/saphelp_nw04/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/29/345d3b7c32a527e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/94553b4d53273de10000000a114084/content.htm
    <b>The following link has entire configuration of Receiver XI Adapter (including acknowledgements)</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/f4/0a1640a991c742e10000000a1550b0/content.htm
           <b>   eror handling in BPM.  
    </b>
    1. CCMS monitoring
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/42fb24ff-0a01-0010-d48d-ed27a70205a8
    2. BPM Monitoring
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e7bc3a5a-0501-0010-1095-eb47159e169c
    3. Monitoring XML Messages http://help.sap.com/saphelp_nw04/helpdata/en/41/b715045ffc11d5b3ea0050da403d6a/frameset.htm
    /people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically
    monitoring BPm https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e7bc3a5a-0501-0010-1095-eb47159e169c
    Reconciliation of Messages in BPM - /people/krishna.moorthyp/blog/2006/04/08/reconciliation-of-messages-in-bpm
    Also see the below BPM related links
    check list for BPM https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bf550d4-0201-0010-b2ae-8569d193124e
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cb/15163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm
    Many other examples can be found under the following link at help.sap.com
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    And some weblogs
    https://weblogs.sdn.sap.com/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken]
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm *****
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    /people/michal.krawczyk2/blog/2005/09/04/xi-do-you-realy-enjoy-clicking-and-waiting-while-tracing-bpm-steps *****
    /people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements *****
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    /people/kannan.kailas/blog/2005/12/07/posting-multiple-idocs-with-acknowledgement
    Also have a look at these seminars,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/daea5871-0701-0010-12aa-c3a0c6d54e02
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/e8515171-0701-0010-be98-e37bec4706cc
    Thanks !!!
    Regards
    Abhishek Agrahari
    Questions are welcome here!!
    <b>Also mark helpful answers by rewarding points</b>

  • Option for error handling for DTP, ' no updata, no reporting" and "deactiva

    Hello Gurus,
         option for error handling for DTP, ' no updata, no reporting" and "deactivated" , please give some explanation and instance for them?
    Many Thanks,

    On the Update tab page, specify how you want the system to respond to data records with errors:
                                a.      No update, no reporting (default)
    If errors occur, the system terminates the update of the entire data package. The request is not released for reporting. However, the system continues to check the records.
                                b.      Update valid records, no reporting (request red)
    This option allows you to update valid data. This data is only released for reporting after the administrator checks the incorrect records that have not been updated and manually releases the request by setting the overall status on the Status tab page in the monitor (QM action).
                                c.      Update valid records, reporting possible
    Valid records can be reported immediately. Automatic follow-up actions, such as adjusting the aggregates, are also carried out.
    http://help.sap.com/saphelp_smehp1/helpdata/en/42/fbd598481e1a61e10000000a422035/content.htm
    Hope it helps.
    rgds, Ghuru

  • What are the best practices for exception handling in n-tier applications?

    What are the best practices for exception handling in n-tier applications?
    The application is a fat client based on MVVM pattern with .NET framework.

    What are the best practices for exception handling in n-tier applications?
    The application is a fat client based on MVVM pattern with
    .NET framework.
    That would be to catch all exceptions at a single point in the n-tier solution, log it and create user friendly messages displayed to the user. 

  • Best Practise for rebooting ISE Nodes?

    Hello Community,
    I administer an ISE installation with two nodes (I am not an ISE Specialist, my job is just to manage the user/mac-adresses... but now I have to move my ISE Nodes from one VMWare Cluster to another VMWare Cluster.
    (Both VMWare environments are connected to our enterprise network, but are different environments. vMotion not possible)
    I would shutdown ISE02, move it to our new VMWare environment and start it again.
    Than I would do this with our ISE01 Node...
    Are there any best practises for doing this? (Shutdown application first, stopl replikation etc)?
    Can I really simply reboot an ISE Node - or have I consider something bevor I doing this? After I doing this?
    Any tasks after reboot?
    Thank you for any answer!
    ISE01    
    Administration, Monitoring, Policy Service    
    PRI(A), SEC(M)
    ISE02    
    Administration, Monitoring, Policy Service    
    SEC(A), PRI(M)

    There is a lot to consider here.  If changing environments means changing IP Address and IP Scopes, then your policies, profiles, and dACLs would also have to change among other things.  If this is the case, create a new ISE VM in the new environment using the built in evaluation license and recreate the deployment from the old environment using the addressing scheme of the new environment.  Then spin-up a new Secondary node and register it on the Primary.  Once this is done, you can re-host the license from your old environment onto your new environment.  You can use this tool to re-host:
    https://tools.cisco.com/SWIFT/LicensingUI/loadDemoLicensee?FormId=3999
    If IP Addressing is to remain the same, it gets simpler. 
    First, and always, perform a configuration and operational backup.
    If downtime is not an issue, or if you have a maintenance window of an hour or so: Simply shut down both nodes.  Transfer them to the New Environment and turn them on, Primary Node first, of course.
    If downtime is an issue, shut down the Secondary Node and transfer it to the New Environment.  Start the Secondary Node and when it is up, shut down the Primary Node.  Once services on the primary node have stopped, promote the Secondary Node to Primary Node.
    Transfer the OLD Primary Node to the New Environment and turn it on.  It should assume the role of Secondary Node.  If it does not, assign that role through the GUI.
    Remember, the correct way to shut down an ISE node is:
    application stop ise
    halt
    By using these commands, the risk of database corruption decreases by about 90% (Remember to always backup).
    Please Rate Helpful posts and mark this question as answered if, in fact, this does answer your question.  Otherwise, feel free to post follow-up questions.
    Charles Moreton

  • SAP Best Practises for Logistic Modules

    Dear Reader,
    Does anyone know how to find SAP Best Practises for Netweaver 2004s Logistic scenarios (SD, MM,)
    The old Netwvr 2004 scenarioas are less helpful, especially in Inventory mgmt.
    Thanks

    Check this link, this is the latest I guess.
    [SAP Best Practices|http://help.sap.com/bp_bw370/html/index.htm]
    Cheers,
    Neel.

  • Best practises for replication

    Hi,
    I want to know what is best practise for duration of replicaation of database between two Cisco ACS.
    Regards,
    Atif.

    Hi Atif,
    The replication time interval should always be higher.
    Reason: Everytime you replicate the data it requires ACS services to restart so doing this frequently may affect your production enviroment.
    However, if you want to replicate internal user's password then there is an option to replicate password changes right awayvwithout a full replication.  You can enable this option under System Configuration -> Local Password Management.  With this enabled you could potentially set the replications to a larger interval.
    It also depend how often you do changes in your ACS. If its normal then I would say set it to every sunday 12:00 PM.
    This is how replication happens:
    The primary ACS stops its authentication and creates a copy of the ACSinternal database components that it is configured to replicate. During this
    step, if AAA clients are configured properly, those that usually use the primary ACS fail over to another ACS. The primary ACS resumes its authentication service.
    After the preceding events on the primary ACS, the database replication process continues on the secondary ACS. The secondary ACS stops its authentication service and replaces its database components with the database components that it received from the primary ACS. During this step, if AAA clients are configured properly, those that usually use the secondary ACS fail over to another ACS. The secondary ACS resumes its authentication service.
    HTH
    Regards,
    JK
    Plz rate helpful posts-

  • Best Practises for doing Master Scheduling using SNP

    Hello Gurus ,
                         Can you please suggest the best practises for doing Master Scheduling using SNP . Which engine to use , what would that mean etc
    Regards,
    Nick

    APC Back-UPS XS 1300.  $169.99 at Best Buy.
    Our power outages here are usually only a few seconds; this should give my server about 20 or 25 minutes run-time.
    I'm setting up the PowerChute software now to shut down the computer when 5 minutes of power is left.  The load with the monitor sleeping is 171 watts.
    This has surge protection and other nice features as well.
    -Noel

  • Wats the best practise for performance

    Hi all,
    In my out line i have 15 dimensions and for one dimension i have 39000 members so wat is the best practise for performance , If we have more dimensions and more meebers is there any problem for performance
    so wat is the best practise for dimensions and members??
    Thanks in advance??

    If it is ASO application it is not a problem.
    If it is a BSO application surely it will hit the performance.
    More dimensions will create performance issues.
    If the said 39000 members dimension is a Flat dimension. It will be another issue.
    If BSO is obvious try to split into two models.
    Create intermediate groupings for the Filat dimension.

  • How to install Best Practise for HCM

    Hi all:
        Could you please tell me how to install best practise for HCM , as there is no autoran file.
        Thank you very much!!!
    Best regards
    Frank

    Hi,
    Did you chk this link;
    http://help.sap.com/content/bestpractices/overview/index.htm
    http://help.sap.com/bp_hcmv1600/HCM_US/HTML/index.htm
    Regards
    CSM Reddy

  • Best Practise for Data Refresh & Hierarchy

    Hi,
    During a recent discussion with one of our BI user groups, the questions were raised as what the best practice are to handle the following two issues.
    Issue 1:
    If entries are posted to the prior periods in SAP R/3 (outside of the daily auto-refresh range), the current process is that the user group will ask us to conduct a manual refresh in BI for the prior periods which are effected.
    Question: Is it possible to set up a trigger in the system, so that BI knows which periods are changed and automatically refreshes data for those periods?
    Issue 2:
    If a hierarchy used in the reports is modified, there might be an adverse impact on the financial data the user group reports. The current process we have in place is to run a group of BI reports for both current year and prior year to make sure nothing is impacted, but there is limitation to this current process. What if there is no impact on current or prior year, but on the years prior to that?
    Question: What other global companies do to minimize such reporting impact, especially when they have hundreds of complex reports?
    If someone has any info on this, help me in sharing the same.
    Thanks all for your support.
    Regards,
    Murali

    Hi Srini,
    1. SAP suggestes to implement data archiving strategy  as early as possible to manage database growth .
    However pople think of archiving when they realise the  problems like large data volumes,slow system resonse time,performance issues etc...
    2. There is a proper way to implement Data Archiving . Database has to be anaylzed first for getting the top DB tables and Archiving objects.
    3. Based on the DB analysis ,Data archiving plan has to be implenemted according to data management guide.
    4. There is a minimum period known as residence time has to be completed before any data to be archived. Once the document is business completed and serverd its minimum required period in the Database ,it can be archived.
    5, Before going for data archiving there are many steps to be followed like analysis,configuration etc that you can see in details at the link below :
    http://help.sap.com/saphelp_47x200/helpdata/en/2e/9396345788c131e10000009b38f83b/frameset.htm
    let me know if this helps you .
    -Supriya
    Edited by: Supriya  Shrivastava on May 4, 2009 10:38 AM

Maybe you are looking for

  • Script won't run in firefox but does in IE, chrome and safari

    i have a landing page with a web form script, www.wholewoman.com/newpages/landing/helpforcystocele.html. the script does not show up in firefox. further, none of our videos (served from kaltura (CDN) show up in firefox. nor does the registration scri

  • Xrandr dual monitors not displaying correctly.

    When I use xrandr to try and run a dual monitor setup instead of having them mirror the screen turns into a mess of pixels. The mouse behaves correctly but I can no longer see windows or anything like that. I am using the radeon driver and OpenBox. A

  • 3D issue Acrobat XI Pro

    I have been using Acrobat Pro 9 to add 3D images (mostly .WRL/VRML and .dae files) to lecture notes that I use to teach.  I just upgraded to Acrobat XI Pro and was surprised to find that the 3D capability was gone.  Is the only option to spend anothe

  • Using XML

    Hi, Now i am flash actionscript programmer for 10 months. Now I am trying to learn flex. So i would like to know how can i parse the xml in flex. Can anybody help me? Thanks and regards,                     Sreelash

  • I can not get into my adobe photoshop elements.  It shows it is working but photos never show.

    My photshop elements program never loads.  It shows it is working but no photos ever show up.