apiaryio/apiary-client — pull request #33 by honzajavorek (2014-04-15 09:38:17+00:00)
Title: Propagating of errors from the Apiary.io service

Closes #20.

Those `unless (200..299).include? response.code` statements would never get to be executed anyway, because `RestClient` raises exceptions in case the response code isn't okay.

If preview server is running, it logs the stacktrace of `abort` statements and continues to run. I am not sure what is the best solution of that - I thought it should just shut down with the error message, but I couldn't get to that behaviour. I kept using `abort`s so it follows the convention I've seen in everywhere else the gem.

The code's not very DRY, but I feel still quite new to Ruby so I could refactor it into something more elegant.