Download wp-calypso/client/landing/stepper/hooks/use-capture-flow-exception.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/use-capture-flow-exception.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/hooks/use-capture-flow-exception.ts
-
curl -L -o use-capture-flow-exception.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/use-capture-flow-exception.ts
644 Bytes
| import { captureException } from '@automattic/calypso-sentry'; | |
| import { useCallback } from 'react'; | |
| import { useIntent } from './use-intent'; | |
| import { useSite } from './use-site'; | |
| const useCaptureFlowException = ( flowName: string | null, stepName: string ) => { | |
| const flow = flowName || 'default'; | |
| const intent = useIntent() || null; | |
| const site = useSite(); | |
| return useCallback( | |
| ( error: any ) => { | |
| captureException( error, { | |
| tags: { | |
| blog_id: site?.ID || null, | |
| calypso_section: 'setup', | |
| flow, | |
| intent, | |
| stepName, | |
| }, | |
| } ); | |
| }, | |
| [ flow, intent, site ] | |
| ); | |
| }; | |
| export default useCaptureFlowException; | |