Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error handling for updates_for edge cases #155

Merged
merged 2 commits into from
Oct 6, 2021

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 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.

None yet

2 participants