Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function loadYAMLConfigFile (filePath) {
debug('Loading YAML config file: ' + filePath)
try {
// empty YAML file can be null, so always use
return loadYamlFile.sync(filePath) || {}
} catch (e) {
debug('Error reading YAML file: ' + filePath)
e.message = 'Cannot read config file: ' + filePath + '\nError: ' + e.message
throw e
}
}