Skip to content

Commit

Permalink
Add server err message response
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpeterkort committed Nov 19, 2024
1 parent bb2b9dd commit 821431f
Show file tree
Hide file tree
Showing 9 changed files with 545 additions and 480 deletions.
5 changes: 3 additions & 2 deletions cmd/caliperload/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ var Cmd = &cobra.Command{
elemChan := make(chan *gripql.RawJson)
wait := make(chan bool)
go func() {
if err := conn.BulkAddRaw(elemChan); err != nil {
log.Errorf("bulk add error: %v", err)
_, err := conn.BulkAddRaw(elemChan)
if err != nil {
log.Errorf("bulk add raw error: %v", err)
}
wait <- false
}()
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
Expand Down
12 changes: 0 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,8 @@ github.com/bmeg/golib v0.0.0-20200725232156-e799a31439fc h1:/0v/ZcXYjGs44InmjECr
github.com/bmeg/golib v0.0.0-20200725232156-e799a31439fc/go.mod h1:hoSeuZtqe58ANXHuWpeODx4bDHGV36QXlCs1yrUvK6M=
github.com/bmeg/jsonpath v0.0.0-20210207014051-cca5355553ad h1:ICgBexeLB7iv/IQz4rsP+MimOXFZUwWSPojEypuOaQ8=
github.com/bmeg/jsonpath v0.0.0-20210207014051-cca5355553ad/go.mod h1:ft96Irkp72C7ZrUWRenG7LrF0NKMxXdRvsypo5Njhm4=
github.com/bmeg/jsonschema/v5 v5.3.4-0.20241021223433-465090062767 h1:Xxna7pNl+RSeb8Chpo/9kqnCpINE3UYazHAEHQfKPr8=
github.com/bmeg/jsonschema/v5 v5.3.4-0.20241021223433-465090062767/go.mod h1:W6ZrtycDFIco8t+VZvgCgt2mUb+o8Js25o6g+Pe/CHU=
github.com/bmeg/jsonschema/v5 v5.3.4-0.20241111204732-55db82022a92 h1:Myx/j+WxfEg+P3nDaizR1hBpjKSLgvr4ydzgp1/1pAU=
github.com/bmeg/jsonschema/v5 v5.3.4-0.20241111204732-55db82022a92/go.mod h1:6v27bSBKXyIDFqlKQbUSnHlekE1y6bDkgWCuVEaDPng=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241021183544-dce95050d690 h1:f7blYURrwfFXm2a5Pk8UWVgQ3Hplx6X3/5orm6vArVQ=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241021183544-dce95050d690/go.mod h1:q2uV/fFytbCs5tnoN59Ae6we8L3N2QIZWjdaxnsEKfQ=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241023220331-fc0d420f80de h1:ruds+GrDg5RyDf8b1cSBnmk4zajcvkXBeAfPzV9my0I=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241023220331-fc0d420f80de/go.mod h1:nqCeZ/A/5zbxrwO5IBF2+xLdaP1sjtaCckmdQIo6lJM=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241111211001-6d92b7fbe785 h1:x0j4hpAp66XUyKXZQpFoM3C1uKimdca8cHik4wqg9uM=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241111211001-6d92b7fbe785/go.mod h1:m8xz9oMFKu1fxV/febWizc4vE/Z/N7DUnrdmT68w7Cs=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241113174920-a424e30e36b5 h1:BMpZ8+q45BhK8SRtjrjz6QE1xUJ36YoffcLf3R2nGk8=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241113174920-a424e30e36b5/go.mod h1:k04v50661tQFKgYl6drQxWGf9q0dBmKhd6lwIk1rcCw=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241113190142-5e57a1561020 h1:7/dWlBDJdKYhtF31LO8zXcw/IcYsmp/MWpydk6PzuNA=
github.com/bmeg/jsonschemagraph v0.0.3-0.20241113190142-5e57a1561020/go.mod h1:k04v50661tQFKgYl6drQxWGf9q0dBmKhd6lwIk1rcCw=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
Expand Down Expand Up @@ -355,8 +345,6 @@ github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis=
github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4=
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
Expand Down
10 changes: 5 additions & 5 deletions gripql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ func (client Client) BulkAdd(elemChan chan *GraphElement) error {
return err
}

func (client Client) BulkAddRaw(elemChan chan *RawJson) error {
func (client Client) BulkAddRaw(elemChan chan *RawJson) (error, *BulkJsonEditResult) {
sc, err := client.EditC.BulkAddRaw(context.Background())
if err != nil {
return err
return err, nil
}
for elem := range elemChan {
err := sc.Send(elem)
if err != nil {
return err
return err, nil
}
}
_, err = sc.CloseAndRecv()
return err
res, err := sc.CloseAndRecv()
return err, res
}

func (client Client) BulkDelete(delete *DeleteData) error {
Expand Down
10 changes: 5 additions & 5 deletions gripql/gripql.pb.dgw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 821431f

Please sign in to comment.