Shell/alias: Print detailed error when deleting alias
STR_GEN_ERR_NOT_FOUND is added and currently is only used by alias command. This string template can be used by other commands as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
This commit is contained in:
@ -153,10 +153,13 @@ ShellCommandRunAlias (
|
||||
Status = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (Status == EFI_ACCESS_DENIED) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
|
||||
ShellStatus = SHELL_ACCESS_DENIED;
|
||||
} else if (Status == EFI_NOT_FOUND) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias", Param1);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user