Reporting Successes and Errors
Let’s learn to write code to report successes and errors in the script we've written.
Reporting partial success
First, let’s report partial success as we go until there’s an error. We’ll enter this at the end of pipeline_errors.exs
after the module:
Press + to interact
# Add this code after the module in pipeline_error.exsIO.puts "Report partial success:"Worker.stream_work|> Enum.take(10)|> IO.inspect
To see this in action, we’ll run this script through the following command:
Executable
Press + to interact
elixir pipeline_errors.exs
Output
Report partial success:
[
...