aboutsummaryrefslogtreecommitdiffstats
path: root/src/mdn/receivedMDNInfos.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-22 13:32:52 +0100
committerVincent Richard <[email protected]>2013-11-22 13:32:52 +0100
commit96077ce7e6125cdba959925d0a2b7b1f8ee54046 (patch)
treeaa478ebd974ce101e8e16d9c6cbab32643725a31 /src/mdn/receivedMDNInfos.cpp
parentDo not throw exception for normal code flow. (diff)
downloadvmime-96077ce7e6125cdba959925d0a2b7b1f8ee54046.tar.gz
vmime-96077ce7e6125cdba959925d0a2b7b1f8ee54046.zip
Do not throw exception for normal code flow (exceptions::no_such_field).
Diffstat (limited to 'src/mdn/receivedMDNInfos.cpp')
-rw-r--r--src/mdn/receivedMDNInfos.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp
index 1c523be7..53b2281e 100644
--- a/src/mdn/receivedMDNInfos.cpp
+++ b/src/mdn/receivedMDNInfos.cpp
@@ -110,18 +110,23 @@ void receivedMDNInfos::extract()
header fields;
fields.parse(oss.str());
- try { m_omid = *fields.OriginalMessageId()->getValue <messageId>(); }
- catch (exceptions::no_such_field&) { /* Ignore */ }
+ shared_ptr <messageId> omid =
+ fields.findFieldValue <messageId>(fields::ORIGINAL_MESSAGE_ID);
- try { m_disp = *fields.Disposition()->getValue <disposition>(); }
- catch (exceptions::no_such_field&) { /* Ignore */ }
+ if (omid)
+ m_omid = *omid;
- try
- {
- text t = *fields.findField("Received-content-MIC")->getValue <text>();
- m_contentMIC = t.generate();
- }
- catch (exceptions::no_such_field&) { /* Ignore */ }
+ shared_ptr <disposition> disp =
+ fields.findFieldValue <disposition>(fields::DISPOSITION);
+
+ if (disp)
+ m_disp = *disp;
+
+ shared_ptr <text> contentMIC =
+ fields.findFieldValue <text>("Received-content-MIC");
+
+ if (contentMIC)
+ m_contentMIC = contentMIC->generate();
}
}
}