Skip to content

Commit

Permalink
Merge pull request #2475 from OffchainLabs/descriptive-error-httpvali…
Browse files Browse the repository at this point in the history
…dationserver

Produce a more descriptive error when validation server url is not set to a WS/WSS server
  • Loading branch information
ganeshvanahalli authored Jul 12, 2024
2 parents 7d1d84c + d5facad commit 9ccd934
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"errors"
"fmt"
"net/url"
"testing"

"github.com/offchainlabs/nitro/arbstate/daprovider"
Expand Down Expand Up @@ -428,8 +429,13 @@ func (v *StatelessBlockValidator) Start(ctx_in context.Context) error {
return fmt.Errorf("starting execution spawner: %w", err)
}
}
for _, spawner := range v.execSpawners {
for i, spawner := range v.execSpawners {
if err := spawner.Start(ctx_in); err != nil {
if u, parseErr := url.Parse(v.config.ValidationServerConfigs[i].URL); parseErr == nil {
if u.Scheme != "ws" && u.Scheme != "wss" {
return fmt.Errorf("validation server's url scheme is unsupported, it should either be ws or wss, url:%s err: %w", v.config.ValidationServerConfigs[i].URL, err)
}
}
return err
}
}
Expand Down

0 comments on commit 9ccd934

Please sign in to comment.