You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have been able to confirm this by creating an RPC method that adds field errors depending on incoming value:
context'with multiple calls, where the first returns an error, the second doesnt'doit'should not raise a Gruf::Client::Error the second time',run_thing_server: truedoclient=build_clientexpectdoclient.call(:GetContextualFieldErrorFail,id: 1)end.toraise_error(Gruf::Client::Error)expectdoclient.call(:GetContextualFieldErrorFail,id: 2)end.to_notraise_error(Gruf::Client::Error)endend
It will throw an error currently:
expected no Gruf::Client::Error, got #<Gruf::Client::Error: Gruf::Client::Error> with backtrace:
This seems to be due to @error being set memoized on the service class, and not reset in-between calls. This was designed in order to support the add_field_error method without having to pass around an error object. A simple fix is just to unset the @error attribute at the end of every call.
The text was updated successfully, but these errors were encountered:
Have been able to confirm this by creating an RPC method that adds field errors depending on incoming value:
It will throw an error currently:
expected no Gruf::Client::Error, got #<Gruf::Client::Error: Gruf::Client::Error> with backtrace:
This seems to be due to
@error
being set memoized on the service class, and not reset in-between calls. This was designed in order to support theadd_field_error
method without having to pass around an error object. A simple fix is just to unset the@error
attribute at the end of every call.The text was updated successfully, but these errors were encountered: