Error reporting exceptions with non-ascii messages

Description

When an exception is thrown in a plugin, we serialize it to show it to the user. If the exception message contains non-ascii characters, an error is thrown (both if it's a bytestring, or if it's a unicode object).

We should make sure to not obscure the original exception, and to format the message in such a way that non-ascii characters are handled correctly.

Steps to Reproduce

Environment:
OS (CLI), HA cluster, cloud provider
------------------------------------

Steps to reproduce:
------------------
1. Create a blueprint with a python script in an operation (example attached)
2. Install the blueprint, and execute the script, by doing eg. {{ cfy exe sta -dd1 execute_operation -p operation=foo.bar -f }}

Expected result:
---------------
The error message is shown in the log

Actual result:
-------------
An UnicodeEncodeError is thrown (in both cases) and the original error is not shown.

Why Propose Close?

None

Status

Assignee

Łukasz Maksymczuk

Reporter

Łukasz Maksymczuk

Labels

None

Severity

Medium

Target Version

4.4

Premium Only

no

Found In Version

4.4

QA Owner

Lital Hamami

Bug Type

legacy bug

Customer Encountered

Yes

Customer Name

Metaswitch

Release Notes

yes

Priority

None

Epic Link

Sprint

None

Fix versions

Priority

Unprioritized