haskell / hackage-security

Hackage security framework based on TUF (The Update Framework)
http://hackage.haskell.org/package/hackage-security
56 stars 48 forks source link

Better error message when deserializing bad root.json #251

Open brandon-leapyear opened 3 years ago

brandon-leapyear commented 3 years ago

We're trying to configure stack to use a private Hackage instance, and we kept seeing the message:

Could not deserialize <repo>/root.json: Schema error: Expected field "signed"

Adding trace statements and building stack manually, we were able to find out that it was attempting to parse

{
  "errors": [
    {
      "status": 401,
      "message": "Authentication is required"
    }
  ]
}

It would be nice if the message could show, in some way, the JSON file that failed to be parsed