@@ -13,6 +13,7 @@ import { analytics } from './utils/analytics';
1313import { runSvelteWizard } from './svelte/svelte-wizard' ;
1414import { runReactNativeWizard } from './react-native/react-native-wizard' ;
1515import { EventEmitter } from 'events' ;
16+ import chalk from 'chalk' ;
1617
1718EventEmitter . defaultMaxListeners = 50 ;
1819
@@ -54,21 +55,30 @@ async function runWizard(argv: Args) {
5455
5556 analytics . setTag ( 'integration' , integration ) ;
5657
57- switch ( integration ) {
58- case Integration . nextjs :
59- await runNextjsWizard ( wizardOptions ) ;
60- break ;
61- case Integration . react :
62- await runReactWizard ( wizardOptions ) ;
63- break ;
64- case Integration . svelte :
65- await runSvelteWizard ( wizardOptions ) ;
66- break ;
67- case Integration . reactNative :
68- await runReactNativeWizard ( wizardOptions ) ;
69- break ;
70- default :
71- clack . log . error ( 'No setup wizard selected!' ) ;
58+ try {
59+ switch ( integration ) {
60+ case Integration . nextjs :
61+ await runNextjsWizard ( wizardOptions ) ;
62+ break ;
63+ case Integration . react :
64+ await runReactWizard ( wizardOptions ) ;
65+ break ;
66+ case Integration . svelte :
67+ await runSvelteWizard ( wizardOptions ) ;
68+ break ;
69+ case Integration . reactNative :
70+ await runReactNativeWizard ( wizardOptions ) ;
71+ break ;
72+ default :
73+ clack . log . error ( 'No setup wizard selected!' ) ;
74+ }
75+ } catch ( error ) {
76+ clack . log . error (
77+ `Something went wrong. You can read the documentation for PostHog at ${ chalk . cyan (
78+ `${ INTEGRATION_CONFIG [ integration ] . docsUrl } ` ,
79+ ) } to setup PostHog manually.`,
80+ ) ;
81+ process . exit ( 1 ) ;
7282 }
7383}
7484
0 commit comments