Skip to content

repo-updater: Include extra context if graphql unmarshaling fails

Administrator requested to merge json-context into master

Created by: keegancsmith

A user is reporting that the list affiliated query is failing against github.com. I am unable to reproduce this and the error message given by go has no context. I am unsure if it is a regression, but for some reason go is not reporting the field it is failing to unmarshal.

The error returned by the json library includes the offset the error occurred at. This commit uses that and the response's byte buffer to include extra context in the error message. This should help us narrow down which field is giving us the issue, and adjust our client / file a bug against github.

Part of https://github.com/sourcegraph/sourcegraph/issues/218

Merge request reports

Loading