fix: delay error
This commit is contained in:
parent
ac7c2088fd
commit
12be9eb754
|
@ -1,7 +1,7 @@
|
|||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
gitea-client (0.5.0)
|
||||
gitea-client (0.6.0)
|
||||
rest-client (~> 2.1.0)
|
||||
|
||||
GEM
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require "json"
|
||||
module Gitea
|
||||
module Api
|
||||
class ServerError < Common::Exception
|
||||
|
@ -5,11 +6,11 @@ module Gitea
|
|||
|
||||
def initialize(response)
|
||||
@http_code = response.code
|
||||
|
||||
puts response
|
||||
@attrs = JSON.parse(response.body) rescue {}
|
||||
end
|
||||
|
||||
def to_s
|
||||
@attrs.delete('documentation_url')
|
||||
@attrs.merge({'HTTPCode' => @http_code}).map do |k, v|
|
||||
[k, v].join(": ")
|
||||
end.join(", ")
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'base64'
|
||||
require 'json'
|
||||
|
||||
module Gitea
|
||||
module Api
|
||||
|
@ -99,7 +100,7 @@ module Gitea
|
|||
response.return!
|
||||
end
|
||||
|
||||
response
|
||||
JSON.parse(response)
|
||||
end
|
||||
|
||||
def get_user_agent
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitea
|
||||
VERSION = "0.5.0"
|
||||
VERSION = "0.6.0"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue