We seem to hav regressed in handling API errors in Ajax dialogues, which should nicely render as Toast messages. I ran into two examples:
- I wanted to update soc-min in the flex-model dialogue, but used a kW value. The API responded with:
{
"message": {
"json": {
"soc-min": [
"Cannot convert value `5kW` to 'MWh'"
]
}
},
"result": "Rejected",
"status": "UNPROCESSABLE_ENTITY"
}
That is good, but the Toast message was not showing the message. Maybe a regression in displaying the error (Failed to update the flex model: [object Object]).
- Second example: On the sensor page, I uploaded data which the sensor already had. The API responded with:
{
"message": "Some of the data represents a replacement, which is reserved for customized servers. If you are hosting FlexMeasures, you can enable replacements by setting FLEXMEASURES_ALLOW_DATA_OVERWRITE=True in the configuration settings. Alternatively, update the prior in your request.",
"results": "Rejected",
"status": "INVALID_REPLACEMENT"
}
That is good, but the Toast messages I saw contained one letter each (treating the message as a list?).
We seem to hav regressed in handling API errors in Ajax dialogues, which should nicely render as Toast messages. I ran into two examples:
That is good, but the Toast message was not showing the message. Maybe a regression in displaying the error (
Failed to update the flex model: [object Object]).That is good, but the Toast messages I saw contained one letter each (treating the
messageas a list?).