28da6c4ecb
Currently, when loading command with sub-commands that fail to parse, we result with command that: * Is not considered nested (has no sub-commands) * Has no action of its own The commit contains a few changes: 1. Protection in the dispatch that will prevent NPE 2. Change in the command parsing that will no load a command if all its sub-commands failed to parse 3. We will add a warning in this case (the solution is somewhat hacky, due to the hack that was there previously) When such command is passed to a dispatch we crash with NPE. Closes #9448
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
// Copyright (c) Microsoft Corporation
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
// SettingsLoadWarnings are scenarios where the settings contained
|
|
// information we knew was invalid, but we could recover from.
|
|
enum SettingsLoadWarnings
|
|
{
|
|
MissingDefaultProfile = 0,
|
|
DuplicateProfile = 1,
|
|
UnknownColorScheme = 2,
|
|
InvalidBackgroundImage = 3,
|
|
InvalidIcon = 4,
|
|
AtLeastOneKeybindingWarning = 5,
|
|
TooManyKeysForChord = 6,
|
|
MissingRequiredParameter = 7,
|
|
LegacyGlobalsProperty = 8,
|
|
FailedToParseCommandJson = 9,
|
|
FailedToWriteToSettings = 10,
|
|
InvalidColorSchemeInCmd = 11,
|
|
InvalidSplitSize = 12,
|
|
FailedToParseStartupActions = 13,
|
|
FailedToParseSubCommands = 14,
|
|
WARNINGS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder.
|
|
};
|
|
|
|
// SettingsLoadWarnings are scenarios where the settings had invalid state
|
|
// that we could not recover from.
|
|
enum SettingsLoadErrors
|
|
{
|
|
NoProfiles = 0,
|
|
AllProfilesHidden = 1,
|
|
ERRORS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder.
|
|
};
|
|
}
|