Remove some uneeded string mutation in the error generator

Signed-off-by: Sam Phippen <samphippen@googlemail.com>