morph/GetContractByID: Fix error handling when contract not found #1211

Open
achuprov wants to merge 1 commits from achuprov/frostfs-node:bugfix/ftostfd-adm_panic_contact_id into master
Collaborator

Close: #1210

Signed-off-by: Alexander Chuprov a.chuprov@yadro.com

Close: #1210 Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov added 1 commit 2024-06-27 16:30:52 +00:00
DCO action / DCO (pull_request) Successful in 3m46s Details
Vulncheck / Vulncheck (pull_request) Successful in 4m20s Details
Build / Build Components (1.21) (pull_request) Successful in 5m30s Details
Build / Build Components (1.22) (pull_request) Successful in 6m48s Details
Tests and linters / gopls check (pull_request) Failing after 6m17s Details
Tests and linters / Lint (pull_request) Successful in 7m19s Details
Tests and linters / Staticcheck (pull_request) Successful in 9m27s Details
Pre-commit hooks / Pre-commit (pull_request) Successful in 11m1s Details
Tests and linters / Tests with -race (pull_request) Successful in 11m53s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 12m7s Details
Tests and linters / Tests (1.22) (pull_request) Successful in 12m34s Details
58b2738702
[#1210] morph/GetContractByID: Fix error handling when contract not found
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov requested review from storage-core-committers 2024-06-27 16:31:18 +00:00
achuprov requested review from storage-core-developers 2024-06-27 16:32:48 +00:00
achuprov changed title from morph/GetContractByID: Fix error handling when contract not found to WIP: morph/GetContractByID: Fix error handling when contract not found 2024-06-27 16:49:57 +00:00
fyrchik requested changes 2024-06-27 17:35:56 +00:00
@ -433,2 +433,2 @@
cs, err := r.GetContractByID(1)
if err != nil {
cs, err := helper.GetContractByID(r, 1)
if cs != nil || err != nil {

Why do we need != nil comparison here?

Why do we need `!= nil` comparison here?
@ -181,0 +185,4 @@
// However, if the returned state.Contract is nil, it returns an error indicating that the contract was not found.
// See https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/1210
func GetContractByID(r *management.ContractReader, id int32) (*state.Contract, error) {
nnsCs, err := r.GetContractByID(id)

It is no nnsCs longer, just cs

It is no `nnsCs` longer, just `cs`

The component in commit seems wrong, should be just adm:

The component in commit seems wrong, should be just `adm:`
achuprov force-pushed bugfix/ftostfd-adm_panic_contact_id from 58b2738702 to e651979c9c 2024-06-28 13:33:41 +00:00 Compare
achuprov force-pushed bugfix/ftostfd-adm_panic_contact_id from e651979c9c to 78e3f4834b 2024-06-28 13:35:49 +00:00 Compare
achuprov changed title from WIP: morph/GetContractByID: Fix error handling when contract not found to morph/GetContractByID: Fix error handling when contract not found 2024-06-28 13:35:52 +00:00
All checks were successful
DCO action / DCO (pull_request) Successful in 10m2s
Vulncheck / Vulncheck (pull_request) Successful in 11m30s
Build / Build Components (1.21) (pull_request) Successful in 13m28s
Build / Build Components (1.22) (pull_request) Successful in 13m25s
Tests and linters / gopls check (pull_request) Successful in 12m53s
Tests and linters / Lint (pull_request) Successful in 14m47s
Tests and linters / Staticcheck (pull_request) Successful in 14m27s
Pre-commit hooks / Pre-commit (pull_request) Successful in 17m36s
Tests and linters / Tests (1.21) (pull_request) Successful in 18m0s
Tests and linters / Tests with -race (pull_request) Successful in 18m1s
Tests and linters / Tests (1.22) (pull_request) Successful in 18m23s
This Pull Request doesn't have enough approvals yet. 0 of 2 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1211
There is no content yet.