Split out formatting and printing of the determined error.
Allow the failure type to be provided.

This way the error can be determined after a build is Abandoned or
while it is still Running (if it is known to have a failed step).
Try to determine what error caused a build to fail.

The message "Can't convert workflow errors to build errors." will no
longer be displayed. If an error can't be determined, "[Unable to
automatically determine error.]" will appear instead.