Error Handling and Error Messages

I already posted this in the java programming forum, but I dont think the people responded understand patterns, or what I was asking. Here is my original post, for reference I am not asking how to catch and exception, or how to display an error, I am asking about the pattern implementation.
I am currently in the process of creating my Exception model for my program, and I have a question about error messages. I was reading the book "Effective Java Programming" which deals with patterns and it states that an exception should state the error and report information on all relavent states. For instance If you have a class the modeled some sort of memory array, and an access was requested to a block of memory outside the array you should throw an ArrayIndexOutOfBoundsException("Index:" + index + ", start:" + 0 + ",end:" + Array.length) or if you made your own MemoryAddressOutOfBoundsException(same as above) which when printed should read
ArrayIndexOutOfBoundsException: Index:-1, start:0, end:0
stack trace
The pertinate information is the index, start index, and end index.
The book CLEARLY states as an industry design pattern that exceptions weather checked or unchecked should not contain user error messages. For instance with the above example one might be tempted to use this as the exception message: "The memory addres index is not a valid memory address." This is clearly a user error message.
So heres my situation. In a gui environment (command line console not visible) how do you generated a user error message, letting the user know that an internal exception has occured.
In my previous implementation of my project, I used the exception message the user error message and just reported the message on a dialog. I have heard of people using error catalogs, which centrallizes all the error messages into a single class or file.
I was wondering if and Error catalog was a good approach, how I might go about implementing one, and if not how do you the community handle user error messages.

class MyAppErrors {
   public static final int FILE_NOT_FOUND = 0;
   public static final int DIR_NOT_FOUND = 1;
   public stat final String[] errMsgs = {
      "The file was not found.",
      "The directory was not found.",
   public String getErrMsg( int n ) { return errMsgs[n]; }
[\code]
And a nicer version would allow the calling code to pass in a substring so you could say "The file 'somename.ext' was not found."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • ESB error handling and notification features

    Hello everyone,
    I am newbie to oracle SOA ESB. I am an oracle apps guy.
    This being my first post to this forum, I have a lot of questions. :-)
    For a small intergration requirement, we are looking for a good integration tool
    Some requirements are:
    1) Flat files will be generated by concurrent programs on oracle apps which need to be transferred to legacy systems.
    2) Pick the data from apps tables and insert them into another database. Not much translation required.
    After some research, found ESB to be a good fit.
    Before actually start using it, we wanted to do a couple of POCs.
    So far we are using shell scripts for ftp process. We opted for an integration tool to have DB to DB transmission. Apart from this we need better error handling and error notification mechanism.
    Some error conditions:
    1) Unavailability of ftp server or Database server.
    2) Permission issues. Say some files may not have read, write, deletion permissions. They need to be caught and notified.
    3) Mandatory field missing while inserting data which is read from a flat file into a DB table etc..
    My initial thoughts on error handling are:
    Connection error: To retry for connection errors. If the retry fails send notification via email and also write the failed connection details into an error log file(apart from the server log file).
    Data mismatch: NOtification to be sent with the error details.
    I would like to know What happens to the file if the destination ftp server is unavailable while ESB is trying to FTP the file. Will ESB retain the file with itself and FTP the file once the ftp server is up?
    In BPEL I could see try catch blocks which can be used to handle the errors and thus send notifications.
    ESB documents introduced terms like error hospital related to error handling but I was not able to figure out a way of implementing them. As I am not well versed with XML and WSDL I am probably unable to use the fault tab which is in the routing service. I feel Oracle could have given some samples that explain about ESB error handling.
    Also to my dismay, adapter docs say that there is a limitation of 7MB size for ftping. Although our file sizes often fall below this size, I would want to know if there is any workaround to over come this size constraint.
    I think I put a lot of stuff in a single post and may be in the most haphazard way. Please bear with me.
    Please suggest me of some documents if any related to my questions.
    Would be really great if you can give me a straight forward solution to all the above problems
    Hope this forum would be a great help to me.
    Cheers,
    Robert.

    I have worked on a few SOA Apps implementations. Some successful and some not so. It really comes down to the type of integrations.
    But I would say the majority of your integration will be batch as this is what eBus is all about. If this is the case then I would recommend Oracle Data Integrator. If you go Oracle Data Integrator Suite it includes Service Bus and BPEL. ODI has an eBusiness Suite adapter as well.
    The good thing about ODI is that you can use it for data conversion, that conversion can then be reused once live, so the conversion is not throw away.
    In SOA 10.1.3.4 the limit of 7MB has been resolved but you must be using the file / FTP adapter for input and out, from the sounds of it you want to call concurrent programs so this probably wouldn't work.
    cheers
    James

  • Messages from PI are successful , but not shown in AIF error handling and monditoring

    Dear All,
    We have messages being triggered from PI to proxy and to AIF.
    Messages status is shown as successful in sxmb_moni transaction but I don't get to see these in /AIF/err - error handling and monitoring transaction.
    WHat could be the possible reason? would there be any missing authorization.
    Note: this is working in Development but having this issue in test environment.
    Thanks and Regards,
    Archana

    Hi Archana,
    About ERR_WEB, probably run an old version, but this won't help you either, I think.
    Another tip is to look in PI:
    Is your service synchronous? For synchronous messages PI only persists the message in PI's message store if the abap proxy returns an error, such as a SOAP Fault. If your abap proxy is not returning an error, then make sure it does. You can raise an application error in AIF.
    If PI already receives a SOAP fault, then I suggest you to check if the message was stored in PI: see SAP note 872388 to guide you on this task.

  • 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>

  • Get these two error messages when I run the iTunes exe file:  Error 2 and Error 2 (Windows error 2).  Both say Apple Application Support is required.  Uninstalled and tried to install again several times.  Using Windows 7 64 bit on laptop.

    Trying to install iTunes on my Dell laptop with Windows 7 - 64 bit.  Get these two error messages when I run the iTunes exe file:  Error 2 and Error 2 (Windows error 2).  Both say Apple Application Support was not found.  Can anyone tell me why this is happening?

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Ok so I cant open my Itunes due to Windows Error 2 and the message says to uninstall and re-install Itunes but I'm pretty sure that would wipe the library right? Is there any way to fix the problem and keep my library?

    Ok so I cant open my Itunes due to Windows Error 2 and the message says to uninstall and re-install Itunes but I'm pretty sure that would wipe the library right? Is there any way to fix the problem and keep my library?

    Hi neffn!
    I have an article for you that can help you go through that process of uninstalling and reinstalling iTunes. If you have Windows 7, you will want to see this article:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/ht1923
    and if you are using Windows XP, you will want to reference this article:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/ht1925
    Note that, as it says in those articles:
    iTunes Store purchases or songs imported from CDs are saved in your My Music folder by default and are not deleted by removing iTunes. While it is highly unlikely that you will lose any contents of your iTunes Library when following these steps, it is always a good idea to ensure that your iTunes library is backed up. If you're unsure how to backup, see iTunes: Back up your iTunes library by copying to an external hard drive.
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • HT1349 itunes will not open on my computer, and says I need to reinstall it.  When I try to reinstall itunes I get an error message error #2502 and error #2503

    When I try to open itunes I get a message that says that itunes is corupt and I needto reinstall it.  When I try to reinstall itunes Iget two error messages; error #2502 and error #2503.  How can I get itunes to work?

    Many thanks.
    Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
    Let's try something relatively simple first. Restart the PC. Head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair".
    If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post. (Although the procedure is for Vista and 7 and you've got XP, just read "Computer" as "My Computer", read "Uninstall a program control panel" as "Add or Remove programs control panel" and assume the system is 32-bit, and you'll be doing the right things.)
    Re: I recently updated to vista service pack 2 and I updated to itunes 10.2.1 and ever

  • Request for info on fatal error handling and High-Precision Timing in J2SE

    Hi
    Could anyone please provide me some information or some useful links on fatal error handling and High-Precision Timing Support in J2SE 5.0.
    Thanks

    Look at System.nanoTime

  • Putting a row into a pageable cache failed with error 9 and error message

    Hi Guys,
                 I am fetting the follwoing message when the job is scheduled.
    Putting a row into a pageable cache failed with error <9> and error message <Db::put: Bad file descriptor>
    I read the forum and Manoj has suggested to one of the forum member to change the size of the Pcache setting through the server manager. But I do not see the setting there. can any one please let me know where exactly I can see and increase the size of the Pcache.
    Thanks

    Hi
    I've had the same problem.  We know from other (more meaingful) error messages that we ran out of space for the Pageable Cache, but we've just increased it by 50GB and still get the same error.
    Anyone??
    Btw i don't think you there is a setting for PCache size - it will just use all the free disk you have on the drive where you have located the PCache directory.
    Richard

  • Diff between Error,Warning and Abort message

    Hi Friends
    Can any body tell the Diff between Error,Warning and Abort message
    Thanks

    Error - Its the abnormal behaviour which was not expected. Its means the process has been hualted at this point. Unless and untill you resolve this, you can not procedd further.
    Warnings: Its just the effect of a process it may have on other processes. You can continue doing irrespective of the warnings.
    Abort : to terminate a computer processing or data transfer activity.
    Thanks..
    Shambhu

  • Error installing itunes win 7 home . Run time error R6034 and Error 7 windows error 1114

    I receive these error messages trying to re-install itunes:
    Run time error R6034 and
    Error 7 Windows error 1114.
    started happening about a week ago.
    Any help?
    I tried removing and reinstalling already, same mesages
    G

    Check for .dll files Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files. If you find QTMovie.DLL, or any other .dll files, move them to the desktop. Reboot your computer. Note: Depending on your operating system, you may only have one of the listed paths.
    So they want me to put all of the DLL files to desk top?  I dont have any that have QTmovie
    I have:
    In itunes .resources folder:
    itunes.dll
    itunesRegistry
    In itunesHelper.resources  folder
    ituneshelper.dll
    In Itunes main folder: ie. program files (x86) Itunes
    gnsdk_dsp.dll
    gnsdk_musicid.dll
    gnsdk_sdkmanager.dll
    gnsdk_submit.dll
    iAdCore.dll
    itunes.dll
    itunesadmin.dll
    ituneshelper.dll
    itunesoutlookaddin.dll
    Sorry I'm not a real computer dude but would like to resolve and not lose all my music etc.
    Thanks
    G

  • Error Handling - displaying Error on ALL error events

    I am trying to set up a global error handling page error.cfm so that whenever any error at all occurs I can display my error.cfm page.
    At first I tried the following in the application.cfm page, and then ran a page that tried to output a variable that did not exist, and it seemed to work:
    <cferror type = "EXCEPTION" exception = "any" template = "error.cfm">
    But then it just decided not to work, so I added these
    <cferror type = "REQUEST" template = "error.cfm">
    <cferror type = "VALIDATION" template = "error.cfm">
    Is there a way to make sure that all errors are handled? Am I right in putting all 3 of these in the application.cfm or do I need more (or less?)
    Thanks
    Mark

    It just didn't react to the error, by going to error.cfm, it just threw out the usual CF error as if I had not added CFERROR
    With those 3 statements in there is seems to work, but I wanted to make sure that no matter what error occurs it's going to hit the error.cfm

  • Error #1095 and Error #1090

    I am using Flash player 14.0.0.125 with IE 8. I am constantly getting Error #1095 and Error #1090 when access any report that require flash to load.
    My co-worker's system has the same build as mine and she is not these messages.
    Has anyone experience this issue before and were able to successfully resolve them?

    I am using Flash player 14.0.0.125 with IE 8. I am constantly getting Error #1095 and Error #1090 when access any report that require flash to load.
    My co-worker's system has the same build as mine and she is not these messages.
    Has anyone experience this issue before and were able to successfully resolve them?

  • Error Stack and Error DTP-Doubts.

    Hi Experts,
    I have a doubt on Error Stacks and Error DTP's in BI 7.0.
    For example i am doing a load that has 100 records and 10 of these records have some invalid characters and hence are showing up in the Error Stack.Now I know that i can change these records directly in the Error Stack and then use the Error DTP to process these 10 records.
    But for the remaining 90 records the Error Handling in the Update tab is set to "No Update,No reporting" and hence the original request is red.How do I update these remaining 90 records?Is the only way to set Error Handling to "Valid Records Update,Reporting Possible(Request Green)" so that these error free 90 records are loaded and available for reporting?
    Also what is the advantage of using of the Icon "Manually Post-Process Error Records" that exists in the DTP Monitor window against using Error DTP's?
    Thanks
    Aravind

    Hi...
    If it failed due to issues like Invalid char or error records, you may have the error data alone loaded to Error stack which you can edit and reload using an error DTP.
    Else in case if your entire DTP failed, then you need to retrigger the DTP.
    Handling of Data Records with Errors
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/fbd598481e1a61e10000000a422035/content.htm
    Error Stack
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/fa1acfcf2c1aa2e10000000a422035/content.htm
    Thanks
    Assign points if this helps

  • Error IN and Error OUT

    Is error in and error out important? If I leave out error in & out can I VI still run. What is the purpose of errir in & out?

    To answer Tim's question about automatic error handling and NI VIs:
    The VIs shipped with LabVIEW have the VI property for Automatic Error Handling turned off. We are "supposed" to write good code, which includes good error handling. So the automatic error handling dialog should never be posted from within a VI shipped with LabVIEW. If a call within one of our VIs does not have Error Out wired, it's because we know the execution of the code is correct whether an error occurs there or not (that's the idea, anyway).
    The bulk of the value to automatic error handling is that it allows you to write "quick and dirty" code and easily catch your mistakes. It's most useful for prototyping and initial code development. Production code should always be reworked for good error handling if error handling was not included in the initial design and implementation.
    Error handling often boils down to just helping you identify where an error is occurring and what is wrong. That's what the automatic error handling does for you. It just tells you error xxx occurred at location yyy and it allows you to break in at that location. You then figure out what is going on and add more code to your application to handle the condition (aha - error handling, not just error reporting). For example, what should I do if the file I am to write to already exists and is read-only? Should I just quit? Should I report file open error and quit? Should I report the file is read-only and prompt for a new file?
    Error handling code takes time to design and time to write. If all goes well all the time (shut your eyes and dream for a moment), then most error handling code is not needed. But all does not go well all the time. The better you get at using Error In/Out, the better off you will be in the long run. Wiring Error Out forces you to consider what you will do when an error occurs at that location. It makes you think and you make a conscious decision about what to do (which can include "do nothing"), but obviously a conscious decision is better than the unconscious decision which currently happens when you don't consider errors and hence default to "do nothing".
    Good code doesn't need automatic error handling turned on. There are times when it is helpful to all, e.g. prototyping, and there are times when it is always helpful, such as demos or when the developer simply doesn't want to write error handling code. Not everyone wants to write really good code. And some devious developers may want to find out who's pointing them to read-only files and not let them run their application anymore.
    Roy

Maybe you are looking for

  • Material go out of stock

    Report to display all materials that go out-of-stock- Only Finished Goods. Developed a drill down report for materials details - for totals and subtotals for material stock values by material group and material type. can any one send me code for this

  • Need help with how to call VB proceedure to open Adobe reader pdf file from differnt folders

    Using  MS access 9.0.2720  visual basic proceedure to call Adobe reader to open a specific flle from a folder on my c drive. useing the shell command , shellexecute is not available in the version I'm using. I can call the Reader with this code:   ca

  • Instrument I/O Assistant installation incomplete...Student Edition 7.1

    I'm using LabVIEW 7.1 Student Edition, and I can't seem to get the Instrument I/O Assistant to work. The student edition doesn't come with the Drivers CD, so I got the I/O Asst from ni.com. After reading some other posts I uninstalled the I/O Asst fr

  • How to make Book WSDL available for download?

    Hi, I would like to download Book WSDL v2.0. The Web service API document says "To download the Book WSDL, you must be given access to the Book object". However, i did not find any option inside "role management>record types access" to make it availa

  • Problem with configure engine in console-mode unix

    i have a problem, i tried to configure an engine of enterprise in HP_UX, but the grapical-mode doesn´t work, how can i start the admin console in console-mode??? i tried ./albpmadmcenter -console but not work!!!