mirror of
https://github.com/ente-io/ente.git
synced 2025-06-03 07:49:45 +00:00
[server][cast] Fix err handling
This commit is contained in:
parent
627eab472c
commit
a62edad446
@ -16,6 +16,9 @@ type Repository struct {
|
|||||||
|
|
||||||
func (r *Repository) AddCode(ctx context.Context, pubKey string, ip string) (string, error) {
|
func (r *Repository) AddCode(ctx context.Context, pubKey string, ip string) (string, error) {
|
||||||
codeValue, err := random.GenerateAlphaNumString(6)
|
codeValue, err := random.GenerateAlphaNumString(6)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
_, err = r.DB.ExecContext(ctx, "INSERT INTO casting (code, public_key, id, ip) VALUES ($1, $2, $3, $4)", codeValue, pubKey, uuid.New(), ip)
|
_, err = r.DB.ExecContext(ctx, "INSERT INTO casting (code, public_key, id, ip) VALUES ($1, $2, $3, $4)", codeValue, pubKey, uuid.New(), ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user