A software system reads data from various sources. Whenever there's corrupted data, you want to log it and continue processing other data. How would you design the exception handling mechanism?

  • Ignore corrupted data completely and proceed with the remaining data without logging.
  • Implement a separate error-handling thread to handle data corruption without stopping processing.
  • Stop processing data as soon as corruption is detected to prevent further issues.
  • Use try-except blocks to catch and log exceptions, then continue processing unaffected data.
The correct approach is to use try-except blocks to catch and log exceptions while continuing to process unaffected data. This ensures data integrity and allows for identifying and handling corrupted data while not halting the entire process.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *