exit goroutine on failing assertion to prevent panic