public static void ThrowOnError(this RfcBapiOutputParameter resultCode) { if (resultCode.MessageType != Error && resultCode.MessageType != Abort) { return; } throw new RfcException(resultCode.ToExceptionMessage()); }
private static string ToExceptionMessage(this RfcBapiOutputParameter s) { string message = ""; var properties = s.GetType().GetProperties(); foreach (PropertyInfo propertyInfo in properties) { message += $"{propertyInfo.Name}:{propertyInfo.GetValue(s)},"; } message += $"MessageTypeDefinition: {ToMessageTypeString(s.MessageType)}"; return(message); }