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

Make initAll log a SupportError #4117

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Conversation

romaricpascal
Copy link
Member

initAll was still returning early silently when GOV.UK Frontend is not supported. This makes it log a SupportError to align the message with components that throw SupportErrors in that situation.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4117 August 21, 2023 10:03 Inactive
Copy link
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @romaricpascal

This came up in a previous comment where I thought we already logged!

Rather than two places that throw, do we need a checkSupport() helper?

@romaricpascal
Copy link
Member Author

Oh, had completely missed those. I'm not sure we need a checkSupport as the two places do slightly different things:

  • the base component throws
  • initAll logs

Don't think there's a point in making the initAll catch a potential error to then log it, simpler to just have it run the shared isSupported and log directly 😊

@romaricpascal
Copy link
Member Author

I'll rebase (when I get a more stable connection 😆) and see if it fixes Percy's failure.

@colinrotherham
Copy link
Contributor

Mainly so stack traces go through the same throwing code, easier to mock etc. Not a blocker!

…rted

Aligns its behaviour to how the components behave, rather than silently returning
@romaricpascal romaricpascal force-pushed the initall-support-error-log branch from 78e8e3d to 275a24e Compare August 24, 2023 15:03
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4117 August 24, 2023 15:03 Inactive
@github-actions
Copy link

📋 Stats

File sizes

File Size
dist/govuk-frontend-4.6.0.min.css 118.07 KiB
dist/govuk-frontend-4.6.0.min.js 47.1 KiB
dist/govuk-frontend-ie8-4.6.0.min.css 79.27 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 72.34 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 67.95 KiB
packages/govuk-frontend/dist/govuk/all.mjs 4 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 34.28 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.83 KiB

Modules

File Size
all.mjs 64.5 KiB
components/accordion/accordion.mjs 20.86 KiB
components/button/button.mjs 3.67 KiB
components/character-count/character-count.mjs 20.46 KiB
components/checkboxes/checkboxes.mjs 4.37 KiB
components/error-summary/error-summary.mjs 4.96 KiB
components/exit-this-page/exit-this-page.mjs 15.42 KiB
components/header/header.mjs 2.3 KiB
components/notification-banner/notification-banner.mjs 3.5 KiB
components/radios/radios.mjs 3.37 KiB
components/skip-link/skip-link.mjs 2.12 KiB
components/tabs/tabs.mjs 8.04 KiB

View stats and visualisations on the review app


Action run for 275a24e

@romaricpascal romaricpascal merged commit 380ddc6 into main Aug 24, 2023
@romaricpascal romaricpascal deleted the initall-support-error-log branch August 24, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants