MBS-13453: Avoid double-decoding some errors #3323
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix MBS-13453
Problem
We are getting wide error ISEs that hide the real errors sometimes when there are PSQL problems.
Solution
While the idea in 20640de was correct, the change was too wide in application; it was also decoding errors that did not need it, causing a wide character ISE because of the double decoding.
The actual cause of the double encodings we saw with MBS-11207 seems to be
Devel::StackTrace::as_string
- so this just decodes those error strings rather than all of them.Testing
Manually.
This specific issue can be triggered for testing by changing the host in
DBDefs
to something dumb and utf8ish. I used'♥localhost'
.The double-decoding could be triggered (before this patch) by doing a similar change on a
.sql
data file for a test and then running it - I changedwork.sql
to have an invalid artist ID (to trigger an error) and'♥'
instead of'ABBA'
as an AC name. Then I just triggered the error withprove -lv t/tests.t :: --tests Edit::Work::Create