Properly support error conditions in the DataDecoder class

This patch builds on top of #272.