Skip to content

Commit 84855c9

Browse files
committed
Move error handling comment to the top of scope
1 parent c747fb3 commit 84855c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ function _Release (options, emitter, callback) {
145145
callback(null, results.data)
146146
}
147147
}).catch(err => {
148+
// Create Release error handling
148149
if (err.status === 404) {
149150
const notFoundError = new Error(format('404 Not Found. Review gh-release oAuth Organization access: https://github.com/settings/connections/applications/%s', clientId))
150151
notFoundError.wrapped = err
@@ -158,9 +159,7 @@ function _Release (options, emitter, callback) {
158159
const errorMessage = format('Release already exists for tag %s in %s/%s', options.tag_name, options.owner, options.repo)
159160
return callback(new Error(errorMessage))
160161
}
161-
162-
// Create Release error handling
163-
callback(err)
162+
return callback(err)
164163
})
165164
}).catch(err => {
166165
// Check target error handling

0 commit comments

Comments
 (0)