Improved error model

New error model that has a dedicated state machine for each of the three
failure paths.