コード例 #1
0
 public GraphQLOutput(object data, ExecutionError[] exceptions)
 {
     Data = data;
     if (exceptions != null && exceptions.Length > 0)
     {
         Errors = new List <GraphQLError>();
         foreach (var exception in exceptions)
         {
             var usableException = exception.InnerException ?? exception;
             var error           = new GraphQLError(exception.Message, usableException.StackTrace);
             if (exception.InnerException != null)
             {
                 error.Detail = exception.InnerException.Message;
             }
             Errors.Add(error);
         }
     }
 }
コード例 #2
0
 public GraphQLOutput(object data, ExecutionError[] exceptions)
 {
     Data = data;
     if (exceptions != null && exceptions.Length > 0)
     {
         Errors = new List <GraphQLError>();
         foreach (var exception in exceptions)
         {
             var error          = new GraphQLError(exception.Message, GetExceptionInformation(exception));
             var innerException = exception.InnerException;
             while (innerException != null)
             {
                 error.Detail   = innerException.Message;
                 innerException = innerException.InnerException;
             }
             Errors.Add(error);
         }
     }
 }