-
Notifications
You must be signed in to change notification settings - Fork 662
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
Update code to make it TS 4.4 compatible #1319
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,7 +191,7 @@ export class InstallProvider { | |
} | ||
|
||
return authResult; | ||
} catch (error) { | ||
} catch (error: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As either any or unknown is allowed for the type, we are unable to use more specific types here. If we want to do so, we have to cast the type from unknown inside the catch clause. |
||
throw new AuthorizationError(error.message); | ||
} | ||
} | ||
|
@@ -453,7 +453,7 @@ export class InstallProvider { | |
this.logger.debug('run built-in success function'); | ||
callbackSuccess(installation, installOptions, req, res); | ||
} | ||
} catch (error) { | ||
} catch (error: any) { | ||
this.logger.error(error); | ||
|
||
// Call the failure callback | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,9 +359,11 @@ export class WebClient extends Methods { | |
|
||
return response; | ||
} catch (error) { | ||
this.logger.warn('http request failed', error.message); | ||
if (error.request) { | ||
throw requestErrorWithOriginal(error); | ||
// To make this compatible with tsd, casting here instead of `catch (error: any)` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We run tsd type tests only for web-api package as of today |
||
const e = error as any; | ||
this.logger.warn('http request failed', e.message); | ||
if (e.request) { | ||
throw requestErrorWithOriginal(e); | ||
} | ||
throw error; | ||
} | ||
|
@@ -571,7 +573,7 @@ function paginationOptionsForNextPage( | |
cursor: previousResult.response_metadata.next_cursor as string, | ||
}; | ||
} | ||
return; | ||
return undefined; | ||
} | ||
|
||
/** | ||
|
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.
This has not been safe enough. oauth.v2.access API argments in the code are compatible only with 6.3+