Handle thrown exception in widgets when 'captureOutput' is set to true.