Make error reporting around _g_enum_nick_to_value() more consistent

This commit is contained in:
Gergely Polonkai 2017-11-03 07:17:00 +01:00
parent 3418c22250
commit 091bb38286
5 changed files with 22 additions and 8 deletions

View File

@ -49,9 +49,12 @@ public class Matrix.Event.CallAnswer : Matrix.Event.Call {
_answer_type = typ;
} else {
_answer_type = CallAnswerType.UNKNOWN;
if (Config.DEBUG) {
warning("Unknown value %s for content.answer.type in a m.call.answer event",
node.get_string());
}
}
} else {
warning("content.answer.type is missing from a m.call.answer event");
}

View File

@ -57,9 +57,12 @@ public class Matrix.Event.CallInvite : Matrix.Event.Call {
_offer_type = typ;
} else {
_offer_type = CallOfferType.UNKNOWN;
if (Config.DEBUG) {
warning("Unknown value %s in content.offer.type of a m.call.invite event",
node.get_string());
}
}
} else {
warning("content.offer.type is missing from a m.call.invite event");
}

View File

@ -56,9 +56,11 @@ public class Matrix.Event.RoomGuestAccess : Matrix.Event.State {
} else {
_guest_access = GuestAccess.UNKNOWN;
if (Config.DEBUG) {
warning("Unknown value '%s' in a m.room.guest_access event",
node.get_string());
}
}
} else {
warning("content.guest_access is missing from a m.room.guest_access event");
}

View File

@ -55,6 +55,10 @@ public class Matrix.Event.RoomHistoryVisibility : Matrix.Event.State {
_visibility = vis;
} else {
_visibility = Matrix.HistoryVisibility.UNKNOWN;
if (Config.DEBUG) {
warning("Unknown history_visibility value %s", node.get_string());
}
}
}

View File

@ -51,9 +51,11 @@ public class Matrix.Event.RoomJoinRules : Matrix.Event.State {
} else {
_join_rules = Matrix.JoinRules.UNKNOWN;
if (Config.DEBUG) {
warning("Unknown value %s in a m.room.join_rules event",
node.get_string());
}
}
} else {
_join_rules = Matrix.JoinRules.UNKNOWN;