Add code property to emitted errors