Skip to content


Subversion checkout URL

You can clone with
Download ZIP


API Down Bug #12

wants to merge 1 commit into from

2 participants


I've noticed that the tumblr api is down a lot and when it is the response returned in nil which causes a NoMethodError because it's trying to access an array element on nil in the count method of Post. I've added a resque block to return 0 when tumblr api is down and a response isn't returned so that an exception isn't thrown.


Hey Joe,

Thanks for the pull request, I'm sorry for taking so long to respond. I haven't been working on the Tumblr gem for a long time (I'm not even using Tumblr anymore right now) and I'm still looking for a new maintainer. Because of this, it's difficult to look into patches because they might break something. With your patch, this probably isn't the case, but can you add a simple test for this -- to make sure it won't regress -- and make sure everything still works?

Thanks again!

  • Jeff

Sure no problem. I'm not planning on using Tumblr again in the future either after the issues I've had with it and the fact that I can more quickly throw together a simple blogging system in rails than it took to integrate. It'll have to wait until next week because I'm busy with finals right now but I'll throw in a couple tests and modify the pull request.

@jrozner jrozner closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2011
  1. @jrozner
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/tumblr/post.rb
8 lib/tumblr/post.rb
@@ -22,7 +22,11 @@ def self.count(options = {})
#puts response['tumblr']['posts'].to_yaml
#puts "*****"
- response['tumblr']['posts']['total'].to_i
+ begin
+ response['tumblr']['posts']['total'].to_i
+ rescue
+ 0
+ end
@@ -122,4 +126,4 @@ def self.process_options(*args)
return options
Something went wrong with that request. Please try again.