Pipe error into tmpError when serializing child objects.

Fixes #165