Skip to content

Commit

Permalink
Merge pull request #16 from openSUSE/review_121218_fixes
Browse files Browse the repository at this point in the history
[Review] Request from 'digitaltom' @ 'openSUSE/software-o-o/review_121218_fixes'
  • Loading branch information
coolo committed Dec 18, 2012
2 parents b0fd563 + 63536af commit a800df2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ class MissingParameterError < Exception; end

protected

rescue_from MissingParameterError do |exception|
rescue_from Exception do |exception|
logger.error "Exception: #{exception.class}: #{exception.message}"
logger.error exception.backtrace.join("\n")
@message = exception.message
if request.xhr?
render :template => "error", :layout => false, :status => 400
else
render :template => 'error', :layout => "application", :status => 400
end
layout = request.xhr? ? false : "application"
notify_hoptoad(exception)
render :template => 'error', :layout => layout, :status => 400
end

def set_language
Expand Down
2 changes: 1 addition & 1 deletion app/views/download/appliance.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
end
%>
<%= render(:partial => "download.css") %>
<%= render(:partial => "download", :formats => [:css]) %>
<% unless @flavors.blank? %>
<div class="soo_box">
Expand Down
5 changes: 2 additions & 3 deletions lib/api_connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.get(path)
api_user = CONFIG['api_username']
api_pass = CONFIG['api_password']
request['x-username'] = api_user
# if you know the cookie, you can buypass login - useful in production ;)
# if you know the cookie, you can bypass login - useful in production ;)
request['X-opensuse_data'] = CONFIG['opensuse_cookie'] if CONFIG['opensuse_cookie']
request.basic_auth api_user, api_pass unless (api_user.blank? || api_pass.blank?)
http.read_timeout = 15
Expand All @@ -26,8 +26,7 @@ def self.get(path)
raise "Response was: #{response} #{response.body}"
end
rescue Exception => e
logger.error "Error connecting to #{uri_str}: #{e.to_s}"
return nil
raise "Error connecting to #{uri_str}: #{e.to_s}"
end
end

Expand Down

0 comments on commit a800df2

Please sign in to comment.