lib/you_track/client/request.rb in you_track-0.4.7 vs lib/you_track/client/request.rb in you_track-0.4.8

- old
+ new

@@ -1,8 +1,11 @@ class YouTrack::Client::Request def find(collection, id, options={}) service.data.fetch(collection)[id] || - service.response(status: 404, body: {"error" => "#{collection.to_s.gsub(/s\Z/, "").capitalize} not found."}) + service.response( + :status => options[:error_status] || 404, + :body => { "error" => options[:error_message] || "#{collection.to_s.gsub(/s\Z/, "").capitalize} not found." } + ) end def require_parameters(_params, *_requirements) params = Cistern::Hash.stringify_keys(_params) requirements = _requirements.map(&:to_s)