public MikroApiTrapException(MikroTikResponseFrameDictionary frame) : base(message: GetMessage(frame)) { if (frame.TryGetValue("category", out var v)) { Category = (TrapCategory)int.Parse(v, CultureInfo.InvariantCulture); } }
private static string?GetMessage(MikroTikResponseFrameDictionary frame) { if (!frame.TryGetValue("message", out var message)) { message = null; } return(message); }