From 685271a77a3af85f123eae88875285fa4702941f Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 30 Jul 2007 12:56:22 +0000 Subject: [PATCH] Better error messages git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21749 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ZombieReplicantView.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/ZombieReplicantView.cpp b/src/kits/interface/ZombieReplicantView.cpp index 93311ae06f..c9493469bf 100644 --- a/src/kits/interface/ZombieReplicantView.cpp +++ b/src/kits/interface/ZombieReplicantView.cpp @@ -43,17 +43,21 @@ _BZombieReplicantView_::MessageReceived(BMessage *msg) case B_ABOUT_REQUESTED: { const char *addOn = NULL; - char description[B_MIME_TYPE_LENGTH] = { '\0' }; + char error[1024]; if (fArchive->FindString("add_on", &addOn) == B_OK) { + char description[B_MIME_TYPE_LENGTH] = ""; BMimeType type(addOn); type.GetShortDescription(description); + snprintf(error, sizeof(error), + "Cannot create the replicant for \"%s\". (%s)", + description, strerror(fError)); + } else { + snprintf(error, sizeof(error), + "Cannot locate the application for the replicant. " + "No application signature supplied. (%s)", strerror(fError)); } - char error[1024]; - snprintf(error, sizeof(error), - "Can't create the \"%s\" replicant because the library is in the Trash. (%s)", - description, strerror(fError)); - + BAlert *alert = new (std::nothrow) BAlert("Error", error, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); if (alert != NULL)