Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide err details #11

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions restapi/handlers/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func HandleGetBlobSidecars() func(params blob.GetBlobSidecarsByBlockNumParams) m
}
sidecars, err = service.BlobSvc.GetBlobSidecarsByRoot(hex.EncodeToString(root), indicesInx)
if err != nil {
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalErrorWithError(err))
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalError())
}
} else {
slot, err := util.StringToUint64(blockID)
Expand All @@ -54,7 +54,7 @@ func HandleGetBlobSidecars() func(params blob.GetBlobSidecarsByBlockNumParams) m
}
sidecars, err = service.BlobSvc.GetBlobSidecarsByBlockNumOrSlot(slot, indicesInx)
if err != nil {
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalErrorWithError(err))
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalError())
}
}
payload := models.GetBlobSideCarsResponse{
Expand Down Expand Up @@ -99,7 +99,7 @@ func HandleGetBSCBlobSidecars() func(params blob.GetBSCBlobSidecarsByBlockNumPar
}
sidecars, err := service.BlobSvc.GetBlobSidecarsByBlockNumOrSlot(blockNum, nil)
if err != nil {
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalErrorWithError(err))
return blob.NewGetBlobSidecarsByBlockNumInternalServerError().WithPayload(service.InternalError())
}
// group sidecars by tx hash
bscTxSidecars := make(map[string]*models.BSCBlobTxSidecar)
Expand Down
4 changes: 2 additions & 2 deletions service/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func (e Err) Error() string {
return fmt.Sprintf("%d: %s", e.Code, e.Message)
}

func InternalErrorWithError(err error) *models.Error {
func InternalError() *models.Error {
return &models.Error{
Code: 500,
Message: err.Error(),
Message: "internal error",
}
}

Expand Down
Loading