@@ -9,7 +9,7 @@ module.exports = class Pull {
99 const { error, value } = schema . validate ( config )
1010
1111 if ( error ) {
12- this . logger . warn ( { err : new Error ( error ) , owner, repo } , 'Invalid config' )
12+ this . logger . warn ( { e : new Error ( error ) , owner, repo } , 'Invalid config' )
1313 throw new Error ( 'Invalid config' )
1414 }
1515 this . config = Object . assign ( { } , value , { owner, repo, repoPath : `${ owner } /${ repo } ` } )
@@ -60,8 +60,8 @@ module.exports = class Pull {
6060 await this . hardResetCommit ( incomingPR . base . ref , incomingPR . head . sha )
6161 this . logger . info ( `[${ this . config . repoPath } ]#${ prNumber } Hard reset successful` )
6262 return true
63- } catch ( error ) {
64- this . logger . warn ( { error } , `[${ this . config . repoPath } ]#${ prNumber } Hard reset failed` )
63+ } catch ( e ) {
64+ this . logger . warn ( { e } , `[${ this . config . repoPath } ]#${ prNumber } Hard reset failed` )
6565 }
6666 } else {
6767 const mergable = incomingPR . mergeable_state === 'clean' ||
@@ -88,18 +88,18 @@ module.exports = class Pull {
8888 base
8989 } )
9090 return comparison . data . total_commits > 0
91- } catch ( ex ) {
92- if ( ex . message . match ( / t h i s d i f f i s t a k i n g t o o l o n g t o g e n e r a t e / i) ) {
91+ } catch ( e ) {
92+ if ( e . message . match ( / t h i s d i f f i s t a k i n g t o o l o n g t o g e n e r a t e / i) ) {
9393 return true
94- } else if ( ex . message . match ( / n o t f o u n d / i) ) {
94+ } else if ( e . message . match ( / n o t f o u n d / i) ) {
9595 this . logger . debug ( `[${ this . config . repoPath } ] ${ this . config . owner } :${ base } ...${ upstream } Not found` )
9696 return false
97- } else if ( ex . message . match ( / n o c o m m o n a n c e s t o r / i) ) {
97+ } else if ( e . message . match ( / n o c o m m o n a n c e s t o r / i) ) {
9898 this . logger . debug ( `[${ this . config . repoPath } ] ${ this . config . owner } :${ base } ...${ upstream } No common ancestor` )
9999 return false
100100 } else {
101101 this . logger . warn ( {
102- err : ex ,
102+ err : e ,
103103 owner : this . config . owner ,
104104 repo : this . config . repo ,
105105 head : upstream
@@ -153,8 +153,8 @@ module.exports = class Pull {
153153 await this . addReviewers ( prNumber , reviewers )
154154
155155 this . logger . debug ( `[${ this . config . repoPath } ]#${ prNumber } Updated pull request` )
156- } catch ( error ) {
157- this . logger . warn ( error , `[${ this . config . repoPath } ] Create PR from ${ upstream } failed` )
156+ } catch ( e ) {
157+ this . logger . warn ( e , `[${ this . config . repoPath } ] Create PR from ${ upstream } failed` )
158158 }
159159 }
160160
0 commit comments