Skip to content

Commit

Permalink
update gems
Browse files Browse the repository at this point in the history
  • Loading branch information
frvade committed Sep 2, 2022
1 parent 66f9973 commit e50209e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/resol/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def call(*args, **kwargs, &block)
error_message = "No `#success!` or `#fail!` called in `#call` method in #{service.class}."
raise InvalidCommandImplementation, error_message
else
result
Resol::Success(result.data)
end
rescue self::Failure => e
Resol::Failure(e)
end

def call!(...)
Expand All @@ -70,15 +72,13 @@ def call!(...)

def fail!(code, data = nil)
check_performing do
error = self.class::Failure.new(code, data)
throw(self, Resol::Error(error))
raise self.class::Failure.new(code, data)
end
end

def success!(data = nil)
check_performing do
result = Result.new(data)
throw(self, Resol::Success(result.data))
throw(self, Result.new(data))
end
end

Expand Down

0 comments on commit e50209e

Please sign in to comment.