Skip to content

Commit

Permalink
get_package_dependencies: catch and report exceptions
Browse files Browse the repository at this point in the history
The package kit uses exceptions for error handling, but this tool didn't
catch them so all we got in case of error is "Abort" on the error
output.

Now, the exceptions are caught and reported with the complete error
message.
  • Loading branch information
pulkomandy committed Nov 9, 2015
1 parent 55af491 commit 3df0df9
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -14,6 +14,7 @@
#include <map>

#include <package/RepositoryCache.h>
#include <package/manager/Exceptions.h>
#include <package/manager/RepositoryBuilder.h>
#include <package/solver/Solver.h>
#include <package/solver/SolverPackageSpecifier.h>
Expand Down Expand Up @@ -83,12 +84,13 @@ main(int argc, const char* const* argv)

// add the "installed" repository with the given packages
BSolverRepository installedRepository;
{
BRepositoryBuilder installedRepositoryBuilder(installedRepository,
"installed");
try {
BRepositoryBuilder installedRepositoryBuilder(installedRepository, "installed");
for (int i = 0; i < packageCount; i++)
installedRepositoryBuilder.AddPackage(packages[i]);
installedRepositoryBuilder.AddToSolver(solver, true);
} catch (BFatalErrorException e) {
DIE(B_OK, "%s", e.Details().String());
}

// add external repositories
Expand Down

0 comments on commit 3df0df9

Please sign in to comment.