Error registration/handling logic for python bindings.