Change error to exception.