-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix: Fix typescript client #288
base: master
Are you sure you want to change the base?
Conversation
summary: - Add missing type definitions - Minor changes to error handling behavior breaking changes: - _postData(): Throw UNKNOWN_ERROR when caught error is not type of AxiosError - getUserInfo(): Bubble error instead of returning it directly
@@ -33,7 +33,7 @@ export default class Client { | |||
private readonly URLS: Record<string, string> = {}; | |||
private readonly DOMAIN: string; | |||
|
|||
constructor(clientId, secretKey, isBeta = false, serverAddr = "") { | |||
constructor(clientId: string, secretKey: string, isBeta = false, serverAddr = "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isBeta
, serverAddr
도 type 적어주세요👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default value를 이와 같이 주면 각각 boolean
, string
으로 type inference가 되어서 타입 명시는 안 해줬던 것 같네요.
명시적으로 적어주는 것도 나쁘지 않을 것 같긴 해요
throw new Error("NO_PERMISSION"); | ||
} else if (err.response.status !== 200) { | ||
throw new Error("UNKNOWN_ERROR"); | ||
if (err instanceof AxiosError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Co-authored-by: Injoon Hwang <[email protected]>
후후 1년만에 답글달기 |
summary:
breaking changes: