submissions: fix unhandled error path causing silent failure

This commit is contained in:
Quaternions 2024-12-17 16:15:33 -08:00
parent 6bab1e1b6b
commit 298a68fa97
3 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ func (env *ScriptPolicy) Get(ctx context.Context, id int64) (model.ScriptPolicy,
if errors.Is(err, gorm.ErrRecordNotFound) {
return mdl, datastore.ErrNotExist
}
return mdl, err
}
return mdl, nil
}
@ -29,6 +30,7 @@ func (env *ScriptPolicy) GetFromHash(ctx context.Context, hash uint64) (model.Sc
if errors.Is(err, gorm.ErrRecordNotFound) {
return mdl, datastore.ErrNotExist
}
return mdl, err
}
return mdl, nil
}

View File

@ -19,6 +19,7 @@ func (env *Scripts) Get(ctx context.Context, id int64) (model.Script, error) {
if errors.Is(err, gorm.ErrRecordNotFound) {
return mdl, datastore.ErrNotExist
}
return mdl, err
}
return mdl, nil
}

View File

@ -20,6 +20,7 @@ func (env *Submissions) Get(ctx context.Context, id int64) (model.Submission, er
if errors.Is(err, gorm.ErrRecordNotFound) {
return submission, datastore.ErrNotExist
}
return submission, err
}
return submission, nil
}