fix: delay error

This commit is contained in:
viletyy 2022-06-22 15:58:35 +08:00
parent ac7c2088fd
commit 12be9eb754
4 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
gitea-client (0.5.0)
gitea-client (0.6.0)
rest-client (~> 2.1.0)
GEM

View File

@ -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(", ")

View File

@ -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

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Gitea
VERSION = "0.5.0"
VERSION = "0.6.0"
end