saadpasta / developerFolio

🚀 Software Developer Portfolio Template that helps you showcase your work and skills as a software developer. (This is currently not being actively maintained)
https://developerfolio.js.org/
GNU General Public License v3.0
5.53k stars 2.86k forks source link

throw new Error(ERR.requestMediumFailed) #708

Open gvatsal60 opened 5 months ago

gvatsal60 commented 5 months ago

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

Smartphones

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);

admirhusic commented 5 months ago

Hey, I want to start to contribute to this project. Can you asssign this and #709 to me? :)