codestates / codestates/Lollin-server

[error hanlding] path parameter 오류

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**어떤 에러인가요?**
* query parameter 로 받은 id 값을 riot api로 요청을 보낼 때 오류가 발생했다.

**에러 메세지**
`$ TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters`

**에러 핸들링 방법**
* get 요청을 보내는 axios 의 url 부분에 직접적으로 string 타입의 변수를 집어넣는게 아니라 encodeURI 함수를 이용해 변환을 한다음 url에 추가해서 해결이 되었다.
`url:https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/${encodeURI(param,)}`

**에러 핸들링을 위해 참고한 레퍼런스 링크**
[`링크`](https://hashcode.co.kr/questions/9521/nodejs-%EC%82%AC%EC%9D%B4%ED%8A%B8%EC%A0%91%EA%B7%BC-%EC%8B%9C-request-path-contains-unescaped-characters-%EC%97%90%EB%9F%AC)

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the handler that takes the query parameter id and builds the axios request to the Riot API. Reproduce the ERR_UNESCAPED_CHARACTERS failure with the affected parameter, then verify the request succeeds after the parameter is URI-encoded.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.