Skip to content

Comments

error handling for updates_for edge cases#155

Merged
julianrubisch merged 2 commits intostimulusreflex:masterfrom
leastbad:mismatched
Oct 6, 2021
Merged

error handling for updates_for edge cases#155
julianrubisch merged 2 commits intostimulusreflex:masterfrom
leastbad:mismatched

Conversation

@leastbad
Copy link
Contributor

@leastbad leastbad commented Oct 6, 2021

Two additions:

Component will now report that a url cannot be fetched, and abort with an error log with the failed url.

If there is a mismatch between the number of updates_for elements on the origin page and the url specified (or if the current page changes between updates!) this is handled as follows:

  • if there are not enough elements to fulfill the updates, it will emit a warning log message
  • if there are too many elements, the component will ignore the surplus

Originally, I was going to make it notify the developer that there were mroe data points than could be displayed; however, given the complexity of supporting multiple URLs, which could all have different amounts of numbers, I decided to take a pass on trying to create logic for the "too many" case.

@leastbad leastbad added enhancement proposal javascript Pull requests that update Javascript code labels Oct 6, 2021
@leastbad leastbad added this to the 5.0 milestone Oct 6, 2021
@leastbad leastbad requested a review from julianrubisch October 6, 2021 15:34
@leastbad leastbad self-assigned this Oct 6, 2021
@julianrubisch julianrubisch merged commit 872bf35 into stimulusreflex:master Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement javascript Pull requests that update Javascript code proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants