Add support for encode/decode errors policy