import { RuntimeLogBehavior , RuntimeLogLevels } from "@codotype/core" ; import { logger } from "./logger" ; param error param runtimeLogBehavior export function handlePluginImportError ( error , runtimeLogBehavior ) { logger ( error , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; if ( error . code === "MODULE_NOT_FOUND" ) { logger ( "REGISTRATION ERROR - PLUGIN NOT FOUND" , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; } else { logger ( "REGISTRATION ERROR - OTHER" , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; } logger ( error , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; return Promise . resolve ( null ) ; } export function handleExecuteImportError ( error , runtimeLogBehavior ) { if ( error . code === "MODULE_NOT_FOUND" ) { logger ( "RUNTIME ERROR - GENERATOR NOT FOUND" , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; } else { logger ( "RUNTIME ERROR - OTHER" , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; } logger ( error , { level : RuntimeLogLevels . error } , runtimeLogBehavior ) ; return Promise . resolve ( ) ; }