Download wp-calypso/client/blocks/plugin-scheduled-updates-common/error-utils.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/plugin-scheduled-updates-common/error-utils.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/blocks/plugin-scheduled-updates-common/error-utils.tsx
-
curl -L -o error-utils.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/plugin-scheduled-updates-common/error-utils.tsx
823 Bytes
| import { localizeUrl } from '@automattic/i18n-utils'; | |
| import { translate } from 'i18n-calypso'; | |
| import type { APIError } from '@automattic/data-stores'; | |
| export const handleErrorMessage = ( error: APIError ): string => { | |
| switch ( error.status ) { | |
| case 500: | |
| return translate( | |
| 'Your website is experiencing technical issues. Please refer to our {{a}}support documentation{{/a}} for assistance in resolving this error.', | |
| { | |
| components: { | |
| a: ( | |
| <a | |
| href={ localizeUrl( | |
| 'https://wordpress.com/support/resolve-jetpack-errors/#critical-error-on-the-site' | |
| ) } | |
| target="_blank" | |
| rel="noreferrer" | |
| /> | |
| ) as JSX.Element, | |
| }, | |
| } | |
| ) as string; | |
| default: | |
| // Return the default error message for other error codes | |
| return error.message; | |
| } | |
| }; | |