Geary.RFC822: Ensure various data constructors throw errors

Rather than just silently ignoring error conditions, throw RFC822
errors instead.
This commit is contained in:
Michael Gratton 2020-05-05 21:48:11 +10:00 committed by Michael James Gratton
parent 97e0093e29
commit e0c1fb8a80
10 changed files with 160 additions and 144 deletions

View file

@ -371,7 +371,8 @@ This is the second line.
assert_true(out_buffer.size > (buffer.size+buffer2.size), "Expected sizeable message");
}
private async Geary.RFC822.Message message_from_composed_email(Geary.ComposedEmail composed) {
private async Message message_from_composed_email(ComposedEmail composed)
throws RFC822Error {
return yield new Geary.RFC822.Message.from_composed_email(
composed,
GMime.utils_generate_message_id(composed.from.get(0).domain),

View file

@ -118,7 +118,8 @@ class Integration.Smtp.ClientSession : TestCase {
}
private async Geary.RFC822.Message new_message(Geary.RFC822.MailboxAddress from,
Geary.RFC822.MailboxAddress to) {
Geary.RFC822.MailboxAddress to)
throws Geary.RFC822Error {
Geary.ComposedEmail composed = new Geary.ComposedEmail(
new GLib.DateTime.now_local(),
new Geary.RFC822.MailboxAddresses.single(from)