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