File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,31 +37,23 @@ export async function findDefaultSdkInitFile(
3737
3838 if ( type === 'server' ) {
3939 if ( options ?. serverConfigFile ) {
40- try {
41- const resolvedPath = await resolvePath ( options . serverConfigFile ) ;
42- if ( fs . existsSync ( resolvedPath ) ) {
43- return resolvedPath ;
44- }
45- throw new Error ( `Server configuration file not found: ${ resolvedPath } ` ) ;
46- } catch ( e ) {
47- throw new Error ( `Error resolving server configuration file: ${ options . serverConfigFile } . Cause: ${ e } ` ) ;
40+ const resolvedPath = await resolvePath ( options . serverConfigFile ) ;
41+ if ( fs . existsSync ( resolvedPath ) ) {
42+ return resolvedPath ;
4843 }
44+ throw new Error ( `Server configuration file not found: ${ resolvedPath } ` ) ;
4945 }
5046 for ( const ext of possibleFileExtensions ) {
5147 relativePaths . push ( `sentry.${ type } .config.${ ext } ` ) ;
5248 relativePaths . push ( path . join ( 'public' , `instrument.${ type } .${ ext } ` ) ) ;
5349 }
5450 } else {
5551 if ( options ?. clientConfigFile ) {
56- try {
57- const resolvedPath = await resolvePath ( options . clientConfigFile ) ;
58- if ( fs . existsSync ( resolvedPath ) ) {
59- return resolvedPath ;
60- }
61- throw new Error ( `Client configuration file not found: ${ resolvedPath } ` ) ;
62- } catch ( e ) {
63- throw new Error ( `Error resolving client configuration file: ${ options . clientConfigFile } . Cause: ${ e } ` ) ;
52+ const resolvedPath = await resolvePath ( options . clientConfigFile ) ;
53+ if ( fs . existsSync ( resolvedPath ) ) {
54+ return resolvedPath ;
6455 }
56+ throw new Error ( `Client configuration file not found: ${ resolvedPath } ` ) ;
6557 }
6658 for ( const ext of possibleFileExtensions ) {
6759 relativePaths . push ( `sentry.${ type } .config.${ ext } ` ) ;
You can’t perform that action at this time.
0 commit comments