Handling Soft And Hard Errors For Scientific Applications