Unverified Commit a9930cad authored by Revath S Kumar's avatar Revath S Kumar
Browse files

fix(docLoader): handle exception from kvstore and log error message

In case of an exception when writing or reading from kvStore,
fedify logs the below error, which is confusing and not helpful
for the developers.

```
jsonld.InvalidUrl: Dereferencing a URL did not result in a valid JSON-LD
object. Possible causes are a
n inaccessible URL perhaps due to a same-origin policy (ensure the
server uses CORS if you are using client-side JavaScript), too many
redirects, a non-JSON response, or more than one HTTP Link Header was
provided for a remote context.
URL: "https://w3id.org/security/multikey/v1".
```

So, this patch tries to handle the exception from kvStore and log the error message.

Steps to reproduce the problem

* Use `@fedify/postgres` as kvStore.
* Configure invalid database url.
* Try `curl  -H"Accept: application/activity+json" http://localhost:3000/users/demo`
parent 3feb71c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment