submissions: fix unhandled error path causing silent failure
This commit is contained in:
parent
6bab1e1b6b
commit
298a68fa97
@ -19,6 +19,7 @@ func (env *ScriptPolicy) Get(ctx context.Context, id int64) (model.ScriptPolicy,
|
|||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return mdl, datastore.ErrNotExist
|
return mdl, datastore.ErrNotExist
|
||||||
}
|
}
|
||||||
|
return mdl, err
|
||||||
}
|
}
|
||||||
return mdl, nil
|
return mdl, nil
|
||||||
}
|
}
|
||||||
@ -29,6 +30,7 @@ func (env *ScriptPolicy) GetFromHash(ctx context.Context, hash uint64) (model.Sc
|
|||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return mdl, datastore.ErrNotExist
|
return mdl, datastore.ErrNotExist
|
||||||
}
|
}
|
||||||
|
return mdl, err
|
||||||
}
|
}
|
||||||
return mdl, nil
|
return mdl, nil
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ func (env *Scripts) Get(ctx context.Context, id int64) (model.Script, error) {
|
|||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return mdl, datastore.ErrNotExist
|
return mdl, datastore.ErrNotExist
|
||||||
}
|
}
|
||||||
|
return mdl, err
|
||||||
}
|
}
|
||||||
return mdl, nil
|
return mdl, nil
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ func (env *Submissions) Get(ctx context.Context, id int64) (model.Submission, er
|
|||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return submission, datastore.ErrNotExist
|
return submission, datastore.ErrNotExist
|
||||||
}
|
}
|
||||||
|
return submission, err
|
||||||
}
|
}
|
||||||
return submission, nil
|
return submission, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user