[Messaging] Throw when email message is not found.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 30 Jan 2015 08:46:07 +0000 (09:46 +0100)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 30 Jan 2015 15:14:41 +0000 (00:14 +0900)
Change-Id: I8ed00c756bb0bcf1216b4bce66712b8b2d19885f
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messaging/messaging_util.cc

index 00bb3f9eef2e9b00f2581f321c942b2b49b94ca8..90dd036e9288f2ead50150ed15305f8cc5501eb4 100644 (file)
@@ -512,6 +512,8 @@ std::shared_ptr<Message> MessagingUtil::jsonToMessage(const picojson::value& jso
             email_mail_data_t* mail = NULL;
             if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail)) {
                 // TODO what should happen?
+                LoggerE("Fatal error: message not found: %d!", mail_id);
+                throw common::TypeMismatchException("Failed to find specified email.");
             } else {
                 message = Message::convertPlatformEmailToObject(*mail);
                 email_free_mail_data(&mail,1);