Sha256: cc56a63d585ec54ce72bc07e6fcdcc8fd91fa833f4200c1e72fc9f83610e714b
Contents?: true
Size: 610 Bytes
Versions: 40
Compression:
Stored size: 610 Bytes
Contents
require "json" module Gitea module Api class ServerError < Common::Exception attr_reader :http_code, :error_code, :message def initialize(response) @http_code = response.code @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(", ") end end class CallBackError < ServerError end # CallBackError class ClientError < Common::Exception end # ClientError end # Api end # Git
Version data entries
40 entries across 40 versions & 1 rubygems