Results 1 to 2 of 2

Thread: Handling the 'this should never happen' case in web apps

  1. #1
    Join Date
    Aug 2004
    Location
    Toronto, ON, Canada
    Posts
    101

    Default Handling the 'this should never happen' case in web apps

    In web apps there are many cases where things should just work as expected; for example you get a userId from a link, all links are generated so the link should be valid.

    Now suppose the link has been modified. Either on purpose or by a failed copy and paste action. What should happen?

    What is a good scenario for handling these kind of errors?

    I recently discovered the SimpleMappingExceptionResolver. Is it good practice to throw something like a 'ApplicationInconsistencyException' and let the ExceptionResolver handle it?

    Just wondering what people are doing for these kind of errors.

    S.

  2. #2
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    71

    Default

    personally in that case i like to throw an IllegalArgumentException in that case and pick it up in the exception resolver to show a general error page.

    In previous very large web solutions for large corporates we have flagged certain inconsistancies to be routed into special support logs (and in some cases sending a SNMP trap) because they can indicate either application errors (which have to be fixed) or hacking attempts and these errors can then get linked to any phone support requests that come through.

    This shows the benefit of a good logging strategy and integration into support systems.

    Stuart

Similar Threads

  1. Replies: 46
    Last Post: Jan 19th, 2011, 01:15 PM
  2. Replies: 3
    Last Post: Oct 17th, 2005, 09:55 AM
  3. Replies: 1
    Last Post: Sep 20th, 2005, 09:14 PM
  4. Replies: 2
    Last Post: Sep 20th, 2005, 12:59 AM
  5. Case insensitive username
    By adepue in forum Security
    Replies: 3
    Last Post: Dec 8th, 2004, 06:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •