Question: What happens when an error occurs that is being handled by the question mark (?) operator?

  1. The error is reported and execution continues.
  2. An exception is raised. The effect(s) of the exception are defined by the error! macro.
  3. The program panics immediately.
  4. Rust attempts to convert the error to the local function's error type and return it as Result::Err. If that fails, the program panics.

Answer: The correct answer of the above question is Option D:Rust attempts to convert the error to the local function's error type and return it as Result::Err. If that fails, the program panics.