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

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

Make all API errors inherit from new ApiError
Make all API errors inherit from new ApiError

This makes them easy to rescue from generically.
