Skip to content

Commit bb7cc7e

Browse files
committed
explicitly define saltfileerror or not
1 parent 80bda22 commit bb7cc7e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/config/loadConfig.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ const log = Debug('CID:loadConfig');
2929
export const CONFIG_FILE_ENCODING: fs.EncodingOption = 'utf-8';
3030

3131
type LoadConfigResult =
32+
| { success: true; lastUpdated: Date; config: Config.Options }
3233
| {
3334
success: false;
3435
error: string;
35-
isSaltFileError?: true;
36-
config?: Config.Options;
36+
isSaltFileError: false;
3737
}
38-
| { success: true; lastUpdated: Date; config: Config.Options };
38+
| {
39+
success: false;
40+
error: string;
41+
isSaltFileError: true;
42+
config: Config.Options;
43+
};
44+
3945

4046
// Main entry point for loading a config file.
4147
// returns:
@@ -54,6 +60,7 @@ export function loadConfig(configPath: string, region: string): LoadConfigResult
5460
return {
5561
success: false,
5662
error: `Unable to read config file '${configPath}'`,
63+
isSaltFileError: false
5764
};
5865
}
5966

@@ -68,6 +75,7 @@ export function loadConfig(configPath: string, region: string): LoadConfigResult
6875
return {
6976
success: false,
7077
error: validationResult,
78+
isSaltFileError: false,
7179
};
7280
}
7381

@@ -80,6 +88,7 @@ export function loadConfig(configPath: string, region: string): LoadConfigResult
8088
return {
8189
success: false,
8290
error: `Configuration file signature mismatch -- required signature is '${configData.meta.signature}' but user configuration has '${configHash}' `,
91+
isSaltFileError: false
8392
};
8493
}
8594

0 commit comments

Comments
 (0)