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

typeError - cannot read property 'line' of undefined #9

Open
li-boxuan opened this issue Oct 26, 2018 · 0 comments
Open

typeError - cannot read property 'line' of undefined #9

li-boxuan opened this issue Oct 26, 2018 · 0 comments

Comments

@li-boxuan
Copy link

I am using graphql-client to fetch data from GitHub.

Usually, errors returned from GitHub looks like this:

[{"message":"Could not resolve to an Organization with the login of 'GCI-AOSSIE'.","type":"NOT_FOUND","path":["organization"],"locations":[{"line":2,"column":3}]}]

However, sometimes GitHub returns errors as follows:

[{"message":"Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `E689:1AF6:67E816:BAAF4C:5BD321E1` when reporting this issue."}]

Note that it doesn't have locations field.
Under the latter circumstance,

var locations = errors.map(function (e) { return e.locations })

together with
var lineErrors = locations.filter(function (loc) { return loc && loc.line === line })

would cause an error: cannot read property 'line' of undefined

c.f. coala/gci-leaders#161 (comment)

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

No branches or pull requests

1 participant