module Api
  ApiError = Class.new(StandardError)
  AuthenticationError = Class.new(ApiError)
  Forbidden = Class.new(ApiError)
  BadRequestError = Class.new(ApiError)
  NotFound = Class.new(ApiError)
  UnsupportedMediaTypeError = Class.new(ApiError)
end

module Api
  class AuthenticationError < StandardError; end
  class Forbidden < StandardError; end
  class BadRequestError < StandardError; end
  class NotFound < StandardError; end
  class UnsupportedMediaTypeError < StandardError; end
end

--- 
+++ 
@@ -1,7 +1,8 @@
 module Api
-  class AuthenticationError < StandardError; end
-  class Forbidden < StandardError; end
-  class BadRequestError < StandardError; end
-  class NotFound < StandardError; end
-  class UnsupportedMediaTypeError < StandardError; end
+  ApiError = Class.new(StandardError)
+  AuthenticationError = Class.new(ApiError)
+  Forbidden = Class.new(ApiError)
+  BadRequestError = Class.new(ApiError)
+  NotFound = Class.new(ApiError)
+  UnsupportedMediaTypeError = Class.new(ApiError)
 end
Make all API errors inherit from new ApiError

This makes them easy to rescue from generically.
