Errors with the same span print the span once

Fix #4569.