File tree Expand file tree Collapse file tree 11 files changed +84
-40
lines changed
templates/components/vectordbs/typescript Expand file tree Collapse file tree 11 files changed +84
-40
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " create-llama " : patch
3+ ---
4+
5+ fix: add trycatch for generating error
Original file line number Diff line number Diff line change @@ -37,8 +37,12 @@ async function loadAndIndex() {
3737}
3838
3939( async ( ) => {
40- checkRequiredEnvVars ( ) ;
41- initSettings ( ) ;
42- await loadAndIndex ( ) ;
43- console . log ( "Finished generating storage." ) ;
40+ try {
41+ checkRequiredEnvVars ( ) ;
42+ initSettings ( ) ;
43+ await loadAndIndex ( ) ;
44+ console . log ( "Finished generating storage." ) ;
45+ } catch ( error ) {
46+ console . error ( "Error generating storage." , error ) ;
47+ }
4448} ) ( ) ;
Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ async function loadAndIndex() {
3030}
3131
3232( async ( ) => {
33- checkRequiredEnvVars ( ) ;
34- initSettings ( ) ;
35- await loadAndIndex ( ) ;
36- console . log ( "Finished generating storage." ) ;
33+ try {
34+ checkRequiredEnvVars ( ) ;
35+ initSettings ( ) ;
36+ await loadAndIndex ( ) ;
37+ console . log ( "Finished generating storage." ) ;
38+ } catch ( error ) {
39+ console . error ( "Error generating storage." , error ) ;
40+ }
3741} ) ( ) ;
Original file line number Diff line number Diff line change @@ -57,8 +57,12 @@ async function loadAndIndex() {
5757}
5858
5959( async ( ) => {
60- checkRequiredEnvVars ( ) ;
61- initSettings ( ) ;
62- await loadAndIndex ( ) ;
63- console . log ( "Finished generating storage." ) ;
60+ try {
61+ checkRequiredEnvVars ( ) ;
62+ initSettings ( ) ;
63+ await loadAndIndex ( ) ;
64+ console . log ( "Finished generating storage." ) ;
65+ } catch ( error ) {
66+ console . error ( "Error generating storage." , error ) ;
67+ }
6468} ) ( ) ;
Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ async function loadAndIndex() {
2929}
3030
3131( async ( ) => {
32- checkRequiredEnvVars ( ) ;
33- initSettings ( ) ;
34- await loadAndIndex ( ) ;
35- console . log ( "Finished generating storage." ) ;
32+ try {
33+ checkRequiredEnvVars ( ) ;
34+ initSettings ( ) ;
35+ await loadAndIndex ( ) ;
36+ console . log ( "Finished generating storage." ) ;
37+ } catch ( error ) {
38+ console . error ( "Error generating storage." , error ) ;
39+ }
3640} ) ( ) ;
Original file line number Diff line number Diff line change @@ -45,8 +45,12 @@ async function loadAndIndex() {
4545}
4646
4747( async ( ) => {
48- checkRequiredEnvVars ( ) ;
49- initSettings ( ) ;
50- await loadAndIndex ( ) ;
51- console . log ( "Finished generating storage." ) ;
48+ try {
49+ checkRequiredEnvVars ( ) ;
50+ initSettings ( ) ;
51+ await loadAndIndex ( ) ;
52+ console . log ( "Finished generating storage." ) ;
53+ } catch ( error ) {
54+ console . error ( "Error generating storage." , error ) ;
55+ }
5256} ) ( ) ;
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ async function generateDatasource() {
3737}
3838
3939( async ( ) => {
40- initSettings ( ) ;
41- await generateDatasource ( ) ;
42- console . log ( "Finished generating storage." ) ;
40+ try {
41+ initSettings ( ) ;
42+ await generateDatasource ( ) ;
43+ console . log ( "Finished generating storage." ) ;
44+ } catch ( error ) {
45+ console . error ( "Error generating storage." , error ) ;
46+ }
4347} ) ( ) ;
Original file line number Diff line number Diff line change @@ -35,9 +35,12 @@ async function loadAndIndex() {
3535}
3636
3737( async ( ) => {
38- checkRequiredEnvVars ( ) ;
39- initSettings ( ) ;
40- await loadAndIndex ( ) ;
41- console . log ( "Finished generating storage." ) ;
42- process . exit ( 0 ) ;
38+ try {
39+ checkRequiredEnvVars ( ) ;
40+ initSettings ( ) ;
41+ await loadAndIndex ( ) ;
42+ console . log ( "Finished generating storage." ) ;
43+ } catch ( error ) {
44+ console . error ( "Error generating storage." , error ) ;
45+ }
4346} ) ( ) ;
Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ async function loadAndIndex() {
2525}
2626
2727( async ( ) => {
28- checkRequiredEnvVars ( ) ;
29- initSettings ( ) ;
30- await loadAndIndex ( ) ;
31- console . log ( "Finished generating storage." ) ;
28+ try {
29+ checkRequiredEnvVars ( ) ;
30+ initSettings ( ) ;
31+ await loadAndIndex ( ) ;
32+ console . log ( "Finished generating storage." ) ;
33+ } catch ( error ) {
34+ console . error ( "Error generating storage." , error ) ;
35+ }
3236} ) ( ) ;
Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ async function loadAndIndex() {
3030}
3131
3232( async ( ) => {
33- checkRequiredEnvVars ( ) ;
34- initSettings ( ) ;
35- await loadAndIndex ( ) ;
36- console . log ( "Finished generating storage." ) ;
33+ try {
34+ checkRequiredEnvVars ( ) ;
35+ initSettings ( ) ;
36+ await loadAndIndex ( ) ;
37+ console . log ( "Finished generating storage." ) ;
38+ } catch ( error ) {
39+ console . error ( "Error generating storage." , error ) ;
40+ }
3741} ) ( ) ;
You can’t perform that action at this time.
0 commit comments