deploy-to-neocities icon indicating copy to clipboard operation
deploy-to-neocities copied to clipboard

Ensure the body of failed requests get printed

Open bcomnes opened this issue 2 years ago • 8 comments

Neocities rejects all sorts of files. We need to do a better job of printing which file its rejecting. Ensure we get the body of bad http request errors from the API and print it, along with the list of files that are being uploaded.

bcomnes avatar Nov 19 '22 20:11 bcomnes

Can I take care of this issue?

adrianmarinwork avatar Nov 19 '22 22:11 adrianmarinwork

Yeah if you feel up to it! The bulk of the work would probably be in https://github.com/bcomnes/async-neocities.

bcomnes avatar Nov 19 '22 22:11 bcomnes

Basically, the goal is to see what the API is saying when it rejects file which I get a lot of reports when people try to upload filetypes that are not allowed: https://github.com/bcomnes/deploy-to-neocities/issues/109

bcomnes avatar Nov 19 '22 22:11 bcomnes

So probably the work has to be done in the repository that you have linked in the comment above to change what the API is returning right?

adrianmarinwork avatar Nov 19 '22 22:11 adrianmarinwork

Yeah

bcomnes avatar Nov 19 '22 22:11 bcomnes

I'm sorry, but do you know an easy way or how to run the neocities-api project locally to test the deploy endpoint?

adrianmarinwork avatar Nov 19 '22 22:11 adrianmarinwork

In the async-neocities repo, if you set a config.json in the root of the repo and add an API key like this:

{
  "token": "1234qwer"
}

But using a real token, it will make API requests against whatever website the Key is associated with. You probably need a paid or secondary account to do that though.

bcomnes avatar Nov 19 '22 22:11 bcomnes

I've trying to run the test.js file with a token I have created in the Riot Developer Portal to test but I'm always getting forbidden error, when getting info about the site for example. Captura

adrianmarinwork avatar Nov 19 '22 23:11 adrianmarinwork