diff --git a/pkg/requesthandler/accounts.go b/pkg/requesthandler/accounts.go index b8b3ea82d..4317ed163 100644 --- a/pkg/requesthandler/accounts.go +++ b/pkg/requesthandler/accounts.go @@ -104,6 +104,7 @@ func (r *RequestHandler) RewardsByOutputID(outputID iotago.OutputID, slot iotago if ierrors.Is(err, kvstore.ErrKeyNotFound) { return nil, ierrors.Wrapf(echo.ErrNotFound, "output %s not found", outputID.ToHex()) } + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get output %s from ledger: %s", outputID.ToHex(), err) } diff --git a/pkg/requesthandler/blocks.go b/pkg/requesthandler/blocks.go index 204f6d3ca..7d42b94e5 100644 --- a/pkg/requesthandler/blocks.go +++ b/pkg/requesthandler/blocks.go @@ -27,6 +27,7 @@ func (r *RequestHandler) BlockMetadataByBlockID(blockID iotago.BlockID) (*api.Bl if ierrors.Is(err, kvstore.ErrKeyNotFound) { return nil, ierrors.Wrapf(echo.ErrNotFound, "block not found: %s", blockID.ToHex()) } + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get block metadata %s: %s", blockID.ToHex(), err) } diff --git a/pkg/requesthandler/utxo.go b/pkg/requesthandler/utxo.go index e82d1cf56..e0b492d58 100644 --- a/pkg/requesthandler/utxo.go +++ b/pkg/requesthandler/utxo.go @@ -16,6 +16,7 @@ func (r *RequestHandler) OutputFromOutputID(outputID iotago.OutputID) (*api.Outp if ierrors.Is(err, kvstore.ErrKeyNotFound) { return nil, ierrors.Wrapf(echo.ErrNotFound, "output %s not found in the Ledger", outputID.ToHex()) } + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get output %s from the Ledger: %s", outputID.ToHex(), err) } @@ -31,6 +32,7 @@ func (r *RequestHandler) OutputMetadataFromOutputID(outputID iotago.OutputID) (* if ierrors.Is(err, kvstore.ErrKeyNotFound) { return nil, ierrors.Wrapf(echo.ErrNotFound, "output %s not found in the Ledger", outputID.ToHex()) } + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get output %s from the Ledger: %s", outputID.ToHex(), err) } @@ -47,6 +49,7 @@ func (r *RequestHandler) OutputWithMetadataFromOutputID(outputID iotago.OutputID if ierrors.Is(err, kvstore.ErrKeyNotFound) { return nil, ierrors.Wrapf(echo.ErrNotFound, "output %s not found in the Ledger", outputID.ToHex()) } + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get output %s from the Ledger: %s", outputID.ToHex(), err) }