Vijitha Kumara wrote:And there is nothing much you can do even you catch an Error.
Depends on the error. A NoClassDefError means a class available at compile time is no longer available. A UnsatisfiedLinkError means a native library cannot be used (it can't be found, or it's missing a dependency). You can catch both and decide to use a workaround.
But I agree that catching errors should be done with very much caution. And OutOfMemoryErrors should never be caught at all.