Is your feature request related to a problem? Please describe.
The error message length has been set to 1024 characters, which is proving too short. For v4.0.3, we changed this to 8192 characters with #2710, but this can still overrun. @bjonkman suggested another option where messages that are about to get truncated will get printed to screen before truncation (see #2710 (comment)).
Describe the solution you'd like
For 5.0, let's add the error handling to @bjonkman's suggestion.
Describe alternatives you've considered
Very long term (v6.0?) we may want to restructure the error message handling, and include logging to file at that point.