GabeDuarteM / semantic-release-chrome

Set of semantic-release plugins for publishing a Chrome extension release
https://www.npmjs.com/package/semantic-release-chrome
MIT License
43 stars 16 forks source link

Provide better error message on 400 Bad Request #69

Closed felixfbecker closed 2 years ago

felixfbecker commented 3 years ago

Issue

What you did and problem description

I'm sometimes seeing a generic 400 Bad Request error like this:

[12:27:16 PM] [semantic-release] › ✖  An error occurred while running semantic-release: ErrorClass [HTTPError]: Response code 400 (Bad Request)
    at /home/runner/work/svg-screenshots/svg-screenshots/node_modules/got/index.js:123:13
    at processTicksAndRejections (node:internal/process/task_queues:93:5) {
  host: 'www.googleapis.com',
  hostname: 'www.googleapis.com',
  method: 'POST',
  path: '/chromewebstore/v1.1/items/nfakpcpmhhilkdpphcjgnokknpbpdllg/publish?publishTarget=default',
  statusCode: 400,
  statusMessage: 'Bad Request',
  pluginName: 'semantic-release-chrome'
}
ErrorClass [HTTPError]: Response code 400 (Bad Request)
    at /home/runner/work/svg-screenshots/svg-screenshots/node_modules/got/index.js:123:13
    at processTicksAndRejections (node:internal/process/task_queues:93:5) {
  host: 'www.googleapis.com',
  hostname: 'www.googleapis.com',
  method: 'POST',
  path: '/chromewebstore/v1.1/items/nfakpcpmhhilkdpphcjgnokknpbpdllg/publish?publishTarget=default',
  statusCode: 400,
  statusMessage: 'Bad Request',
  pluginName: 'semantic-release-chrome'
}

The last time I had this I figured I needed to update some things on the listing, but this time nothing is there. It looks like others have run into this issue before too: https://github.com/GabrielDuarteM/semantic-release-chrome/issues/7

Suggested solution

Is there any way the plugin could provide a better error message with more details? It looks like it currently just gives us the HTTP status code, but I would bet there is some more detail in the response body that is being omitted.

GabeDuarteM commented 2 years ago

Hey!! 👋

Yeah, I've gone through that as well a few times... Unfortunately, the error we print on the console is the exact same one we get out of the request from https://github.com/fregante/chrome-webstore-upload/blob/main/index.js#L36

But I agree that just that generic error is a bit confusing, so I opened #95 to try to build a better error message, with possible reasons for it to be happening. I'll probably merge that tomorrow, but feel free to also add more "possible reasons" there if you find any!

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: