Skip to content

Commit

Permalink
Merge pull request #1072 from travis-ci/ha-trap-octokit-notfound
Browse files Browse the repository at this point in the history
Trap Octokit::NotFound exception
  • Loading branch information
BanzaiMan committed Aug 21, 2019
2 parents ffc4f2f + 50d41dd commit cc5c224
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/dpl/providers/releases.rb
Expand Up @@ -37,6 +37,7 @@ class Releases < Provider
local_tag: 'Current tag is: %{local_tag}',
login: 'Authenticated as %s',
insufficient_scopes: 'Dpl does not have permission to upload assets. Make sure your token has the repo or public_repo scope.',
insufficient_perm: 'Release resource not found. Make sure your token belongs to an account which has push permission to this repo.',
overwrite_existing: 'File %s already exists, overwriting.',
skip_existing: 'File %s already exists, skipping.',
set_tag_name: 'Setting tag_name to %s',
Expand Down Expand Up @@ -132,6 +133,8 @@ def release

def create_release
api.create_release(slug, local_tag, filter(opts).merge(draft: true))
rescue Octokit::NotFound => nf
error :insufficient_perm
end

def local_tag
Expand Down

0 comments on commit cc5c224

Please sign in to comment.