forgeplus/app/libs/ci/drone/error.rb

15 lines
237 B
Ruby

class Ci::Drone::Error < StandardError
attr_reader :code
def initialize(code, message)
super message
@code = code
end
class << self
def parse(result)
new(result['errcode'], result['errmsg'])
end
end
end