There are two different aspects to this:
- Is the bug causing the stack trace a security vulnerability.
- Is the framework configured to show stack traces to outsiders.
The error message
Invalid Character Error sounds a lot like forgotten escaping, which can very often be exploited in some way. So you should be concerned about the stack trace because it is a symptom of a possible security vulnerability.
The other question is whether you should be concerned about stack traces being showed to outsiders. On one hand hiding information about the internals of a system is could be seen as security through obscurity. In most cases I would agree with that, but not in case of stack traces.
The stack traces only show up when there is a problem, so if there ever is a stack trace there is a significant risk that there is a bug, and if there is a bug there is a significant risk it can be exploited. Hence keeping stack traces away from outsiders is a good idea. Moreover if the stack trace contains not only names of the called functions but also parameter values, it can easily leak keys, passwords, cookies, or other kinds of credentials.
For both of the above reasons, it is important to be careful with where your stack traces show up.
It is however important that the stack traces be available to those who need to fix the problem. So logging of stack traces is important. If those cases where the stack traces are indications of actual security vulnerabilities, you want to fix them ASAP. Even though a non-descriptive error message won't give an attacker much to work with, simply from realizing which characters work and which don't, they can possibly figure out how to exploit it anyway.