isFileExist = File::IsFileExist(filePath);
r = GetLastResult();
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_INVALID_ARG] Propagating.");
-
- if (!isFileExist)
- {
- r = E_FILE_NOT_FOUND;
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_FILE_NOT_FOUND] Propagating.");
- }
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_INVALID_ARG , E_INVALID_ARG, "[E_INVALID_ARG] Propagating.");
+ SysTryCatch(NID_MSG, isFileExist == true, r = E_FILE_NOT_FOUND , E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] Propagating.");
r = __pImpl->SetFilePath(type, filePath);
return r;
isFileExist = File::IsFileExist(filePath);
r = GetLastResult();
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_INVALID_ARG] Propagating.");
-
- if (!isFileExist)
- {
- r = E_FILE_NOT_FOUND;
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_FILE_NOT_FOUND] Propagating.");
- }
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_INVALID_ARG , E_INVALID_ARG, "[E_INVALID_ARG] Propagating.");
+ SysTryCatch(NID_MSG, isFileExist == true, r = E_FILE_NOT_FOUND , E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] Propagating.");
r = _DetailedEmailMessageImpl::ParseMimeFile(filePath, message);
return r;
isFileExist = File::IsFileExist(filePath);
r = GetLastResult();
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_INVALID_ARG] Propagating.");
-
- if (isFileExist)
- {
- r = E_FILE_ALREADY_EXIST;
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_FILE_NOT_FOUND] Propagating.");
- }
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_INVALID_ARG , E_INVALID_ARG, "[E_INVALID_ARG] Propagating.");
+ SysTryCatch(NID_MSG, isFileExist == false, r = E_FILE_ALREADY_EXIST , E_FILE_ALREADY_EXIST, "[E_FILE_ALREADY_EXIST] Propagating.");
r = _DetailedEmailMessageImpl::WriteToMimeFile(message, filePath);
return r;
isFileExist = File::IsFileExist(filePath);
r = GetLastResult();
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_INVALID_ARG] Propagating.");
-
- if (!isFileExist)
- {
- r = E_FILE_NOT_FOUND;
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[E_FILE_NOT_FOUND] Propagating.");
- }
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_INVALID_ARG , E_INVALID_ARG,"[E_INVALID_ARG] Propagating.");
+ SysTryCatch(NID_MSG, isFileExist == true, r = E_FILE_NOT_FOUND , E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] Propagating.");
r = __pImpl->SetFilePath(filePath);
pMail->subject = _StringConverter::CopyToCharArrayN(message.GetSubject());
r = AddEmailMessageBody(pMail,_StringConverter::CopyToCharArrayN(message.GetText()));
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add body failed", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] email add body failed", GetErrorMessage(r));
r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_TO, pMail);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] email add recipient failed", GetErrorMessage(r));
r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_CC, pMail);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] email add recipient failed", GetErrorMessage(r));
r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_BCC, pMail);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] email add recipient failed", GetErrorMessage(r));
r = AddEmailMessageAttachment(message, &pAttach, pMail);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] email add recipient failed", GetErrorMessage(r));
if( null != pAttach)
}
r = _MsgUtil::EmailConvertException(err);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "To make email body is failed.");
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] To make email body is failed.", GetErrorMessage(r));
err = email_send_mail(pMail->mail_id, &requestId);
r = _MsgUtil::EmailConvertException(err);
- SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "The sent mail is failed.");
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] The sent mail is failed.", GetErrorMessage(r));
mailId = pMail->mail_id;
}
email_free_mail_data(&pMail, 1);
email_free_mailbox(&pMailbox, 1);
+ email_free_account(&pAccount, 1);
email_service_end();
-
return r;
CATCH:
}
email_free_mail_data(&pMail, 1);
email_free_mailbox(&pMailbox, 1);
+ email_free_account(&pAccount, 1);
email_service_end();
-
return r;
}