using System.Reflection;

namespace TryCatch {

    public class FieldInfo {

        public static System.Object GetValue(System.Reflection.FieldInfo fi,
                                             System.Type typ) {

            System.Object value;

            try {
                value = fi.GetValue(typ);
            } catch (System.Exception e) {
                System.Console.WriteLine(e.Message);
                System.Console.WriteLine(e.StackTrace);
                value = null;
            }
            return value;
        }
    }

}
