ErrorHandling.rst edited online with Bitbucket - Just a test commit to see if code copy-and-pastedfrom the BitBucket docs actually shows up in the user manual.

This commit is contained in:
David Williams 2013-05-16 08:37:50 +00:00
parent 2010b46709
commit afd5f0efc6

View File

@ -45,3 +45,9 @@ Most functions in PolyVox will validate their input parameters and throw an exce
The most notable example of this is when accessing volume data through the get/setVoxel() functions, as these are designed to be very fast. Validating an input position would require multiple conditional operations which we chose to avoid. Therefore, **accessing a voxel outside of a volume will cause undefined behaviour.** When reading voxels it is safer to use the function getVoxelWithWrapping() as this lets you specify how out-of-bounds voxels should be handled.
In addition to the C++ exception handling mechanism, PolyVox also makes use of assertions to verify the internal state of the library at various points. If you hit an assert in PolyVox then there is a good chance it is a bug in the library, as user errors should have been prevented by throwing an exceptions.
.. sourcecode :: python
def wiki_rocks(text):
formatter = lambda t: "funky"+t
return formatter(text)