TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
190 stars 55 forks source link

Fix dependency update that broke Yasr (@types/superagent 4.1.4 => 4.1.7) #163

Closed woutermont closed 4 years ago

woutermont commented 4 years ago

Problem: While working on #162 I stumbled upon an issue in the Yasr code, after upgrading dependencies. Turned out to be caused by @types/superagent, in a minor change (4.1.4 => 4.1.7).

To reproduce: Selectively/interactively upgrade @types/superagent, then try to build Yasr.

Cause: The superagent update changed the type of it's Response.error from ResponseError to the union type false | HTTPError. This breaks a call to error.text in yasr/src/parsers/index.ts.

Fix: Added a boolean check to see whether or not the error is indeed a HTTPError.

Discussion:

LaurensRietveld commented 4 years ago

Thanks @woutermont . I'd prefer the fallback value to be undefined instead of false, as it would nicely align with the typescript interface for that field we already have.

About the auto-formatting: no problem. I think a few files haven't been autoformatted yet. I'll do that after merging

LaurensRietveld commented 4 years ago

Thanks!