add optional error transform function to transmissions

@barnabyc @hojberg