der: fix error reporting in encoder