We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 490e603 commit c9ff3caCopy full SHA for c9ff3ca
lib/redmine_gtt_print/mapfish.rb
@@ -25,9 +25,18 @@ def layouts(print_config)
25
def get_capabilities(print_config)
26
return unless print_config
27
str = URI.escape(print_config)
28
- r = HTTParty.get "#{@host}/print/#{str}/capabilities.json"
29
- if r.success?
30
- return JSON.parse r.body
+ begin
+ url = "#{@host}/print/#{str}/capabilities.json"
+ r = HTTParty.get url
31
+ if r.success?
32
+ return JSON.parse r.body
33
+ else
34
+ Rails.logger.error "failed to get capabilities from #{url} : #{r.code}\n#{r.body}"
35
+ return nil
36
+ end
37
+ rescue HTTParty::Error, StandardError => e
38
+ Rails.logger.error "failed to get capabilities from #{url}\n#{e}"
39
40
end
41
42
0 commit comments