Skip to content

Regression(s) in ajax dialogue error handling #2104

@nhoening

Description

@nhoening

We seem to hav regressed in handling API errors in Ajax dialogues, which should nicely render as Toast messages. I ran into two examples:

  1. 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]).

  1. 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?).

Metadata

Metadata

Assignees

Labels

UIbugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions