View RSS Feed

Recent Blogs Posts

  1. HttpClient Exception handling

    by , 02-24-2012 at 07:01 PM
    Exception types which might be encountered to a HttpClient when HTTP methods are executed, are as following:

    1. protocol exceptions
    2. transport exceptions

    In regular use of the HttpClient, all these exceptions would not propagate to user. Internally handled exceptions by HttpClient have been marked as internal.

    I. Transport exceptions
    II. HTTP transport safety
    III. Protocol exceptions
    IV. Custom exception handler
    V. ...
  2. Exception handling best practices

    by , 01-08-2012 at 11:58 AM
    Following are the best practices when catching and handling exceptions in your java code.

    • Do not catch “Exception” directly in your code. Java exception handling is not polymorphic. If you catch Exception, it can catch IOException or any other descendent type.

    Name:  62.JPG
Views: 964
Size:  35.3 KB

    Catching Exceptions

    • Exception handling supports the stack trace of any error in your code. Always throw an exception early in your code to make this ...
  3. Catching an Exception

    by , 11-29-2011 at 03:07 AM
    Following on from our previous tip on exceptions, in this tip we will look at catching an exception. One of the key concepts to understand is the concept of a guarded region. It is a section of code that might produce exceptions and is followed by the code to handle a particular exception. They are often grouped into all the possible exceptions for a particular method or piece of code.

    The try block
    The first part of the region is the try block. This is when you’re inside a ...