File tree Expand file tree Collapse file tree
src/components/CallToAction/Download Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ The component includes runtime validation:
171171
172172``` typescript
173173if (! resource ) {
174- throw new Error (' Download CTA component requires a "resource" prop' )
174+ const message = ' Download CTA component requires a "resource" prop'
175+ throw new ClientScriptError ({ message })
175176}
176177```
177178
Original file line number Diff line number Diff line change 1616 * ```
1717 */
1818
19+ import { ClientScriptError } from ' @components/scripts/errors'
20+
1921export interface Props {
2022 /** Name of the download resource (matches the folder name in content/downloads) */
2123 resource: string
@@ -42,7 +44,8 @@ const {
4244
4345// Validate that resource is provided
4446if (! resource ) {
45- throw new Error (' Download CTA component requires a "resource" prop' )
47+ const message = ' Download CTA component requires a "resource" prop'
48+ throw new ClientScriptError ({ message })
4649}
4750
4851// Construct the download landing page URL
You can’t perform that action at this time.
0 commit comments