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

Add callback to respond to errors when a component does not initialise in createAll #5212

Closed
3 tasks done
Tracked by #5205
romaricpascal opened this issue Aug 9, 2024 · 2 comments · Fixed by #5252
Closed
3 tasks done
Tracked by #5205
Assignees
Milestone

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Aug 9, 2024

What

Add an option to createAll that allows services to pass a callback function to createAll that will be called if a component fails to initialise (or GOV.UK Frontend is not supported).

Why

So services can react to errors happening during component initialisation with createAll, for example sending a report to an error monitoring service

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • We've decided on the arguments and name of that function
  • We've implemented the function
  • The feature is documented
@romaricpascal
Copy link
Member Author

As a starter, the callback will be added as third parameter, passed either in place of the scope or in an object that contains both scope and the callback. A future piece of work will look at avoiding to have to provide null when the component does not need a config.

@romaricpascal romaricpascal reopened this Aug 22, 2024
@romaricpascal romaricpascal moved this from Backlog 🏃🏼‍♀️ to In progress 📝 in GOV.UK Design System cycle board Aug 27, 2024
@patrickpatrickpatrick patrickpatrickpatrick moved this from In progress 📝 to Ready to release 🚀 in GOV.UK Design System cycle board Aug 28, 2024
@patrickpatrickpatrick
Copy link
Contributor

Going to close as it's been merged into the WIP branch with documentation written for it.

@owenatgov owenatgov added this to the 5.7.0 milestone Jan 7, 2025
@domoscargin domoscargin moved this from Ready to release 🚀 to Done 🏁 in GOV.UK Design System cycle board Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants