Gitaly ref service: teach delete_refs to parse structured errors
Moving decode_detailed_error decode_detailed_error is useful for more than just operation_service. Move this method one level up to GitalyClient so other services can take advantage of it. Move new_detailed_error to spec helper new_detailed_error is a useful helper for specs other than just operations_service_spec. Move this into its own spec helper. Add new git errors Add two new git error types. We will utilize these in a future commit that parses a gRPC detailed error and throws an appropriate error on the Rails side. Teach delete_refs to parse gRPC detailed errors Give delete_refs the ability to catch a gRPC error and parse the detailed error if there is one.
Showing
- lib/gitlab/git.rb 2 additions, 0 deletionslib/gitlab/git.rb
- lib/gitlab/gitaly_client.rb 16 additions, 0 deletionslib/gitlab/gitaly_client.rb
- lib/gitlab/gitaly_client/operation_service.rb 5 additions, 20 deletionslib/gitlab/gitaly_client/operation_service.rb
- lib/gitlab/gitaly_client/ref_service.rb 11 additions, 0 deletionslib/gitlab/gitaly_client/ref_service.rb
- spec/lib/gitlab/gitaly_client/operation_service_spec.rb 0 additions, 13 deletionsspec/lib/gitlab/gitaly_client/operation_service_spec.rb
- spec/lib/gitlab/gitaly_client/ref_service_spec.rb 42 additions, 1 deletionspec/lib/gitlab/gitaly_client/ref_service_spec.rb
- spec/lib/gitlab/gitaly_client_spec.rb 40 additions, 0 deletionsspec/lib/gitlab/gitaly_client_spec.rb
- spec/spec_helper.rb 1 addition, 0 deletionsspec/spec_helper.rb
- spec/support/helpers/detailed_error_helpers.rb 19 additions, 0 deletionsspec/support/helpers/detailed_error_helpers.rb
Please register or sign in to comment