From 4c3e9643f3c2ef550855cd6401d8acf682ff52b2 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 26 Jan 2009 19:13:54 +0000 Subject: [PATCH] raise ValueError on out-of-range --- .../distributed/cDistributedSmoothNodeBase.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.cxx b/direct/src/distributed/cDistributedSmoothNodeBase.cxx index c79affe1fb..1ca73915fc 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.cxx +++ b/direct/src/distributed/cDistributedSmoothNodeBase.cxx @@ -17,6 +17,7 @@ #include "dcField.h" #include "dcClass.h" #include "dcmsgtypes.h" +#include "config_distributed.h" static const float smooth_node_epsilon = 0.01; static const double network_time_precision = 100.0; // Matches ClockDelta.py @@ -349,10 +350,25 @@ finish_send_update(DCPacker &packer) { << _node_path << " pos = " << _store_xyz << " hpr = " << _store_hpr << " zoneId = " << _currL[0]; + +#ifdef HAVE_PYTHON + string message = error.str(); + distributed_cat.warning() + << message << "\n"; + PyErr_SetString(PyExc_ValueError, message.c_str()); +#else nassert_raise(error.str()); +#endif } else { - nassert_raise("Unexpected pack error in DC file."); + const char *message = "Unexpected pack error in DC file."; +#ifdef HAVE_PYTHON + distributed_cat.warning() + << message << "\n"; + PyErr_SetString(PyExc_TypeError, message); +#else + nassert_raise(message); +#endif } #endif }