The error here is what I would normally enter as an assert.  I normally use Exceptions for "run-time errors" (they're all run-time errors in interpreted scripting like Python... but you know what I mean!)  to users, and asserts as "compile-time errors" aimed at programmers.  It's funky here because programmers are kind of like end-users, but ... still can separate from errors based on running / examining / viewing networks vs. errors based on building them.

So just a quick Q: how are y'all drawing the line between asserts and errors?  Knowing that would help this lurker as he tries to understand what y'all are doing and might be able to help raise a flag here and there.