add proper error state to encoder object parsing

fixes #36