Skip to content

Commit 53ae73b

Browse files
committed
fix: add error code for app not found
Add utils::error::ErrorCode::AppNotFoundFromLocal error code to the error message when Cli::info fails to find an application locally. This change improves error traceability by providing a specific error code instead of a generic message, enabling better error handling and debugging capabilities. Influence: 1. Test 'info' command with non-existent local applications 2. Verify error output includes the AppNotFoundFromLocal error code 3. Confirm error message text remains user-friendly 4. Test integration with error handling systems that rely on error codes 5. Verify no regression in existing info command functionality
1 parent 7a18991 commit 53ae73b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • libs/linglong/src/linglong/cli

libs/linglong/src/linglong/cli/cli.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,8 @@ int Cli::info(const InfoOptions &options)
15921592
{ .forceRemote = false, .fallbackToRemote = false });
15931593
if (!ref) {
15941594
LogD("{}", ref.error());
1595-
this->printer.printErr(LINGLONG_ERRV("Can not find such application."));
1595+
this->printer.printErr(LINGLONG_ERRV("Cannot find such application.",
1596+
utils::error::ErrorCode::AppNotFoundFromLocal));
15961597
return -1;
15971598
}
15981599

0 commit comments

Comments
 (0)