developerFolio icon indicating copy to clipboard operation
developerFolio copied to clipboard

throw new Error(ERR.requestMediumFailed)

Open gvatsal60 opened this issue 3 weeks ago • 1 comments

Describe the bug

there is a bug if it won't find medium user or getting forbidden then it will throw an error

statusCode: 403 /home/runner/work/portfolio/portfolio/fetch.js:111 throw new Error(ERR.requestMediumFailed); ^

Error at ClientRequest. (/home/runner/work/portfolio/portfolio/fetch.js:111:13) at Object.onceWrapper (node:events:632:26) at ClientRequest.emit (node:events:517:28) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:700:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:541:22) at TLSSocket.emit (node:events:517:28) at addChunk (node:internal/streams/readable:368:12) at readableAddChunk (node:internal/streams/readable:341:9) at Readable.push (node:internal/streams/readable:278:10)

Steps to reproduce

  1. change the medium username to some other unknown user (not present on medium)

Expected behavior

It should throw a message through exception.

Is this responsiveness Issue

NO

Screenshots

No response

Desktop

  • OS: [Any]
  • Browser: [Any]
  • Version: [Any]

Smartphones

  • Device: [Any]
  • OS: [Any]
  • Browser [Any]
  • Version [Any]

Additional context

You have

const ERR = { noUserName: "Github Username was found to be undefined. Please set all relevant environment variables.", requestFailed: "The request to GitHub didn't succeed. Check if GitHub token in your .env file is correct.", requestFailedMedium: "The request to Medium didn't succeed. Check if Medium username in your .env file is correct." };

It can be fixed by replacing requestMediumFailed

/home/runner/work/portfolio/portfolio/fetch.js:111 throw new Error(ERR.requestMediumFailed);

with throw new Error(ERR.requestFailedMedium);

gvatsal60 avatar Jun 14 '24 01:06 gvatsal60