summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk/unopkg/unopkg_app.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/pkgchk/unopkg/unopkg_app.cxx')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index a5d1fd2f746e..5fc4136a9501 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -470,14 +470,23 @@ extern "C" int unopkg_main()
}
catch (deployment::DeploymentException & exc)
{
+ OUString cause;
+ if (option_verbose)
+ {
+ cause = ::comphelper::anyToString(exc.Cause);
+ }
+ else
+ {
+ css::uno::Exception e;
+ if (exc.Cause >>= e)
+ cause = e.Message;
+ }
+
dp_misc::writeConsoleError(
- OUSTR("\nERROR: ") +
- exc.Message + OUSTR("\n") +
- OUSTR(" Cause: ") +
- OUString(option_verbose ? ::comphelper::anyToString(exc.Cause):
- reinterpret_cast< css::uno::Exception const *>(
- exc.Cause.getValue())->Message) +
- OUSTR("\n"));
+ OUSTR("\nERROR: ") + exc.Message + OUSTR("\n"));
+ if (cause.getLength())
+ dp_misc::writeConsoleError(
+ OUSTR(" Cause: ") + cause + OUSTR("\n"));
}
catch (LockFileException & e)
{