Skip to content

Commit

Permalink
feat(rescues_result_unhandled_exceptions): return original exception …
Browse files Browse the repository at this point in the history
…in data + formatted exception as message
  • Loading branch information
marian13 committed Feb 20, 2023
1 parent 5779f5a commit 45bc55e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def next(*args, **kwargs, &block)
# @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
#
def failure_result_from(exception, *args, **kwargs, &block)
entity.failure(data: {exception: format_exception(exception, *args, **kwargs, &block)})
entity.failure(
data: {exception: exception},
message: format_exception(exception, *args, **kwargs, &block)
)
end

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def result
end

it "returns failure with formatted exception" do
expect(method_value).to be_failure.with_data(exception: formatted_exception)
expect(method_value).to be_failure.with_data(exception: exception).and_message(formatted_exception)
end
end
end
Expand Down

0 comments on commit 45bc55e

Please sign in to comment.