nodeSolidServer / nodeSolidServer/node-solid-server

Fetch 204 resulted in error

Open
#1,231 7 comments 0 reactions 1 assignee View on GitHub

@jaxoncreed is already working on this.

Since Jun 19, 2019.

Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

I got 204 No Content when GET a URI which does not exist, and I want to create it if it does not exist depends on res.status, but following code:

solidAuthClient
          .fetch(uri)
          .then(async (res: Response) => {
            // might be 401 for /private , 403 for ACL blocking , 404 for uncreated, 200 for good
            console.error('getTWContainersOnPOD() get it', uri, res.status);
            return { status: res.status, uri, text: await res.text() };
          })
          .catch(error => {
            console.error('getTWContainersOnPOD() containerTtlFiles', uri, error);
          })

only resulted in

getTWContainersOnPOD() containerTtlFiles https://linonetwo.solid.authing.cn/public/tiddlywiki/main TypeError: Failed to fetch

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.