Handle exceptions in GUI (e. g. division by zero for mass == 0)