25 lines
522 B
Ruby
25 lines
522 B
Ruby
module Gitea
|
|
module Api
|
|
class ServerError < Common::Exception
|
|
attr_reader :http_code, :error_code, :message
|
|
|
|
def initialize(response)
|
|
@http_code = response.code
|
|
|
|
puts response
|
|
end
|
|
|
|
def to_s
|
|
@attrs.merge({'HTTPCode' => @http_code}).map do |k, v|
|
|
[k, v].join(": ")
|
|
end.join(", ")
|
|
end
|
|
end
|
|
|
|
class CallBackError < ServerError
|
|
end # CallBackError
|
|
|
|
class ClientError < Common::Exception
|
|
end # ClientError
|
|
end # Api
|
|
end # Git |