Skip to content

Commit

Permalink
fix: add error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Jul 12, 2024
1 parent 2b1d416 commit 5b896ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions oracle/pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ func (s *Service) registerProvider(token string) http.Handler {

minStake, err := s.providerRegistry.MinStake()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, "Failed to get minimum stake amount", http.StatusInternalServerError)
return
}

stake, err := s.providerRegistry.CheckStake(providerAddress)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, "Failed to check provider stake", http.StatusInternalServerError)
return
}

Expand All @@ -156,13 +156,13 @@ func (s *Service) registerProvider(token string) http.Handler {

txn, err := s.blockTracker.AddBuilderAddress(grafiti, providerAddress)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, "Failed to add provider mapping", http.StatusInternalServerError)
return
}

receipt, err := s.monitor.WaitForReceipt(context.Background(), txn)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, "Failed to get receipt for transaction", http.StatusInternalServerError)
return
}

Expand Down

0 comments on commit 5b896ac

Please sign in to comment.