Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Linq2GraphQL.Client/Exceptions/GraphQueryRequestException.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
namespace Linq2GraphQL.Client;
using System.Net;

namespace Linq2GraphQL.Client;

public class GraphQueryRequestException : Exception
{
public GraphQueryRequestException(string message, string query, Dictionary<string, object> variables) :
public GraphQueryRequestException(string message, HttpStatusCode statusCode, string query, Dictionary<string, object> variables) :
base(message)
{
StatusCode = statusCode;
GraphQLQuery = query;
GraphQLVariables = variables;
}

public string GraphQLQuery { get; private set; }
public Dictionary<string, object> GraphQLVariables { get; private set; }
public HttpStatusCode StatusCode { get; }
public string GraphQLQuery { get; }
public Dictionary<string, object> GraphQLVariables { get; }
}
2 changes: 1 addition & 1 deletion src/Linq2GraphQL.Client/QueryExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal async Task<T> ExecuteRequestAsync(string name, GraphQLRequest graphRequ
{
var content = await response.Content.ReadAsStringAsync(cancellationToken);
throw new GraphQueryRequestException($"Http error! Status code {response.StatusCode} Error: {content}",
graphRequest.Query, graphRequest.Variables);
response.StatusCode, graphRequest.Query, graphRequest.Variables);
}

var con = await response.Content.ReadAsStringAsync(cancellationToken);
Expand Down