Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1131,37 +1131,25 @@ internal static SqlNotification ProcessMessage(SqlXml xmlMessage)
messageAttributes |= MessageAttributes.Source;
break;
case InfoAttribute:
try
{
string value = xmlReader.Value;
// 3 of the server info values do not match client values - map.
switch (value)
{
case "set options":
info = SqlNotificationInfo.Options;
break;
case "previous invalid":
info = SqlNotificationInfo.PreviousFire;
break;
case "query template limit":
info = SqlNotificationInfo.TemplateLimit;
break;
default:
SqlNotificationInfo temp = (SqlNotificationInfo)Enum.Parse(typeof(SqlNotificationInfo), value, true);
if (Enum.IsDefined(typeof(SqlNotificationInfo), temp))
{
info = temp;
}
break;
}
}
catch (Exception e)
string value = xmlReader.Value;
// 3 of the server info values do not match client values - map.
switch (value)
{
if (!ADP.IsCatchableExceptionType(e))
{
throw;
}
ADP.TraceExceptionWithoutRethrow(e); // Discard failure, if it should occur.
case "set options":
info = SqlNotificationInfo.Options;
break;
case "previous invalid":
info = SqlNotificationInfo.PreviousFire;
break;
case "query template limit":
info = SqlNotificationInfo.TemplateLimit;
break;
default:
if (Enum.TryParse(value, true, out SqlNotificationInfo temp) && Enum.IsDefined(typeof(SqlNotificationInfo), temp))
{
info = temp;
}
break;
}
messageAttributes |= MessageAttributes.Info;
break;
Expand Down