return nonzero if error
if exception, send the visualisation that was constructed to help debug