Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw new Error(ERR.requestMediumFailed) #708

Open
gvatsal60 opened this issue Jun 14, 2024 · 1 comment
Open

throw new Error(ERR.requestMediumFailed) #708

gvatsal60 opened this issue Jun 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gvatsal60
Copy link

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 gvatsal60 added the bug Something isn't working label Jun 14, 2024
@admirhusic
Copy link

admirhusic commented Jun 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants