예제 #1
0
        public static void ThrowOnError(this BapiReturnParameter resultCode)
        {
            if (resultCode.MessageType != ERROR && resultCode.MessageType != ABORT)
            {
                return;
            }

            throw new RfcException(resultCode.ToExceptionMessage());
        }
예제 #2
0
        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);
        }