[Config][Exception] Improve Routing Syntax Import Error



| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11300
| License       | MIT
| Doc PR        | n/a
This is removing a trailing period from the previous exception message if there is one:

>
Unable to parse at line 5 (near "pattern /").

Becomes just:

>
Unable to parse at line 5 (near "pattern /")

It looks a little hacky, but it makes sense. I think we should at least add a comment here about what we're doing - I had to stare at this for a minute :).