adm: Fix error handling when contract not found #1211

Merged
fyrchik merged 1 commit from achuprov/frostfs-node:bugfix/ftostfd-adm_panic_contact_id into master 2024-07-02 13:03:45 +00:00
Member

Close: #1210

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

Close: #1210 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 {
Owner

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)
Owner

It is no nnsCs longer, just cs

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

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
fyrchik changed title from morph/GetContractByID: Fix error handling when contract not found to adm: Fix error handling when contract not found 2024-07-01 06:47:04 +00:00
fyrchik approved these changes 2024-07-01 06:48:03 +00:00
acid-ant approved these changes 2024-07-01 07:28:55 +00:00
fyrchik merged commit 74842e7f43 into master 2024-07-02 13:03:45 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 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
No description provided.