This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,7 @@ import { FormulaGenerator } from "automations/FormulaGenerator";
33import { AutomationError , showDBError } from "errors/ErrorTypes" ;
44
55export async function obtainFormulasFromFolder ( config : LocalSettings ) {
6- try {
7- const generator = new FormulaGenerator ( config ) ;
8- return await generator . generate_object ( ) ;
9- } catch ( e ) {
10- showDBError ( AutomationError . LoadFormulas , e ) ;
11- return { } ;
12- }
6+ const generator = new FormulaGenerator ( config ) ;
7+ return await generator . generate_object ( ) ;
138}
149
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { IGenerateObject } from "automations/IGenerateObject";
33import { get_tfiles_from_folder } from "helpers/FileManagement" ;
44import { LocalSettings } from "cdm/SettingsModel" ;
55import { LOGGER } from "services/Logger" ;
6+ import { AutomationError , showDBError } from "errors/ErrorTypes" ;
67
78export class ScriptFunctions implements IGenerateObject {
89 constructor ( private config : LocalSettings ) { }
@@ -21,10 +22,17 @@ export class ScriptFunctions implements IGenerateObject {
2122
2223 for ( const file of files ) {
2324 if ( file . extension . toLowerCase ( ) === "js" ) {
24- await this . load_script_function (
25- file ,
26- script_functions
27- ) ;
25+ try {
26+ await this . load_script_function (
27+ file ,
28+ script_functions
29+ ) ;
30+ } catch ( e ) {
31+ showDBError ( {
32+ error : AutomationError . LoadFormulas . error ,
33+ solution : `check your ${ file . path } js file code`
34+ } , e ) ;
35+ }
2836 }
2937 }
3038 return script_functions ;
You can’t perform that action at this time.
0 commit comments