Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeakyBucketExecutionPolicy fails to handle graph error #685

Closed
nozzlegear opened this issue Nov 15, 2021 · 1 comment · Fixed by #686
Closed

LeakyBucketExecutionPolicy fails to handle graph error #685

nozzlegear opened this issue Nov 15, 2021 · 1 comment · Fixed by #686

Comments

@nozzlegear
Copy link
Owner

Adding this here so I don't forget to add a unit test for this. The LeakyBucketExecutionPolicy class throws a null reference exception when it tries to parse this response from Shopify:

{"errors":[{"message":"Field 'shopOwner' doesn't exist on type 'Shop'","locations":[{"line":8,"column":21}],"path":["query","shop","shopOwner"],"extensions":{"code":"undefinedField","typeName":"Shop","fieldName":"shopOwner"}}]}

Stack trace:

System.NullReferenceException: Object reference not set to an instance of an object.
   at ShopifySharp.LeakyBucketExecutionPolicy.Run[T](CloneableRequestMessage baseRequest, ExecuteRequestAsync`1 executeRequestAsync, CancellationToken cancellationToken, Nullable`1 graphqlQueryCost)
   at ShopifySharp.ShopifyService.ExecuteRequestAsync(RequestUri uri, HttpMethod method, CancellationToken cancellationToken, HttpContent content, Dictionary`2 headers, Nullable`1 graphqlQueryCost)
   at ShopifySharp.GraphService.SendAsync(RequestUri req, HttpContent content, Nullable`1 graphqlQueryCost, CancellationToken cancellationToken)
   at ShopifySharp.GraphService.PostAsync(String body, Nullable`1 graphqlQueryCost, CancellationToken cancellationToken)
   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse@131.Invoke(Unit unitVar0)
   at FSharp.Control.Tasks.TaskBuilder.StepStateMachine`1.nextAwaitable()
--- End of stack trace from previous location ---
   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse@131.Invoke(Unit unitVar0)
   at FSharp.Control.Tasks.TaskBuilder.StepStateMachine`1.nextAwaitable()
--- End of stack trace from previous location ---
   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse@131.Invoke(Unit unitVar0)
   at FSharp.Control.Tasks.TaskBuilder.StepStateMachine`1.nextAwaitable()
--- End of stack trace from previous location ---
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Stages.Server.Program.Main(String[] args) in /home/nozzlegear/repos/stages/src/Stages.Server/Program.cs:line 42
@clement911
Copy link
Collaborator

oops, I submitted a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants