lib/cubits/connection.rb
def respond_with_error(status, message)
      case status
      when 400
        fail BadRequest, message
      when 403
        fail Forbidden, message
      when 404
        fail NotFound, message
      when 415
        fail UnsupportedMediaType, message
      when 500
        fail InternalServerError, message
      when 400...500
        fail ClientError, message
      when 500...600
        fail ServerError, message
      else
        fail ConnectionError, message
      end
    end
# Map unsuccessful HTTP response to appropriate exception and raise it
#
Map unsuccessful HTTP response to appropriate exception and raise it
Map unsuccessful HTTP response to appropriate exception and raise it
def respond_with_error(status, message)
      case status
      when 400
        fail BadRequest, message
      when 403
        fail Forbidden, message
      when 404
        fail NotFound, message
      when 415
        fail UnsupportedMediaType, message
      when 500
        fail InternalServerError, message
      when 400...500
        fail ClientError, message
      when 500...600
        fail ServerError, message
      else
        fail ConnectionError, message
      end
    end
def respond_with_error ( status , message ) case status when 400 fail BadRequest , message when 403 fail Forbidden , message when 404 fail NotFound , message when 415 fail UnsupportedMediaType , message when 500 fail InternalServerError , message when 400 ... 500 fail ClientError , message when 500 ... 600 fail ServerError , message else fail ConnectionError , message end end
Map unsuccessful HTTP response to appropriate exception and raise it
Map unsuccessful HTTP response to appropriate exception and raise it
status
message