The issue is that some error dialog shows
"the JSON object must be str, bytes or
bytearray, not NoneType" when non admin user
tries to modify configuration.
Functional-wise it is expected behavior to
reject configure operation because of
forbidden. But this message is not proper
for users.
This happens when it extracts the error message
from api, it is a case to be empty. The fix
is check empty message and show the default
message if it is empty.
Closes-bug: 2037320
Test Plan:
PASS: Confirm error message dialog contains
proper text in detail.
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/900945 /opendev. org/starlingx/ config/ commit/ 56a6555315fa8da 86f469b18ee83ee a7c5e6ca84
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 56a6555315fa8da 86f469b18ee83ee a7c5e6ca84
Author: Takamasa Takenaka <email address hidden>
Date: Tue Nov 14 18:33:35 2023 -0300
Set default error message for for forbidden
The issue is that some error dialog shows
"the JSON object must be str, bytes or
bytearray, not NoneType" when non admin user
tries to modify configuration.
Functional-wise it is expected behavior to
reject configure operation because of
forbidden. But this message is not proper
for users.
This happens when it extracts the error message
from api, it is a case to be empty. The fix
is check empty message and show the default
message if it is empty.
Closes-bug: 2037320
Test Plan:
PASS: Confirm error message dialog contains
proper text in detail.
Change-Id: I980df3356b60a5 9b19ec8b552f848 e63dec3b621
Signed-off-by: Takamasa Takenaka <email address hidden>