Added comments to error-handling Java code.