Discussions

General J2EE: Error Handling and sending mails(urgent)

  1. Error Handling and sending mails(urgent) (6 messages)

    Hi
    Pls give me tips on doing error handling and sending mails about errors to various persons .
    lot of thanx
    Ashutosh

    Threaded Messages (6)

  2. Elobrate your question[ Go to top ]

    Hi

    > Pls give me tips on doing error handling and sending mails about errors to various persons .
    > lot of thanx
    > Ashutosh

    Hi please elobrate your question, from current message i think that you are getting problem in sending mail
  3. No its not problem of sending mails. I want to know a good design for error handling and also about crash recovery for weblogic integration server.
    regds
    ashutosh
  4. error handling and crash recovery[ Go to top ]

    I guess you can define your own exception class derived from Exception. That way you can have some additional methods in ur exception to handle ur specific requirement.

    My general way will be to send mails at the end of the exception hirarchy.

    i.e. all exception travel upward towards the main calling function. make sure that your customize class has a method to send error report via mails.

    or write a helper class which will send mails and take your exception object as a parameter.

    This is pretty common practice
    Hope this helps


    Regards
    Chetan
  5. error handling and sendig mails[ Go to top ]

    can u send me lld for it.it will help me.
    thanx
    Ashutosh
  6. error handling[ Go to top ]

    can u eloborate me how all exceptions travel upwards.can u send me a lld for it on kumar dot ashutosh at seepz dot tcs dot co.in
  7. error handling[ Go to top ]

    ashutosh,

      exception traveling upward is a basic oop funda. I guess you know that, but I might have put it in such a way that you thought I am talking about something else.

    ok so say ur servlet makes a call to some helper class and inter the helper class calls other class where the exception is happening,

    ServletCall - > helper one-> helper two.

    now helper two has caught IOException in ur helpter two catch block

    instanciate ur custom exception with ur business domain related message.
    and throw the exception. offcourse ur helper two method need to declare throws custom exception in method signature.

    how u r gonna catch custom exception in ur servletcall
    and once u have the exception object u can use the exception.getMessage to get ur business domain related message which was populated at helper 2 level.

    sorry for later reply, didnt see that u have posted some queries.

    hope this helps
    Regards
    Chetan