Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Improve error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jdlehman committed May 25, 2017
1 parent 7e444e1 commit 209eead
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/slugbuilder/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ def fetch_buildpacks
def run_hook(hook_name)
Dir.chdir(@build_dir) do
script = "#{@build_dir}/bin/#{hook_name}"
run(script) if File.exists?(script)
if File.exists?(script)
rc = run(script)
fail "Failed to run #{script}" if rc != 0
end
end
end

Expand Down Expand Up @@ -246,7 +249,7 @@ def release(buildpack)
end
release_file.close

fail "Couldn't compile application using buildpack #{buildpack}" if rc != 0
fail "Couldn't release application using buildpack #{buildpack}" if rc != 0
end

def build_slug
Expand Down Expand Up @@ -282,6 +285,7 @@ def parse_git_url(url)

def normalize_git_url(url)
matches = parse_git_url(url)
fail "Invalid buildpack url: #{url}." unless matches
if Slugbuilder.config.protocol == 'ssh'
"git@#{matches[:host] || Slugbuilder.config.git_service}:#{matches[:org]}/#{matches[:name]}.git"
else
Expand Down

0 comments on commit 209eead

Please sign in to comment.