catch possible TypeError and ValueError from serializer

see issue #204