mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
fix error wrapping (#1737)
This commit is contained in:
parent
3524697f6f
commit
6cc720a1b5
2 changed files with 6 additions and 12 deletions
|
@ -20,10 +20,7 @@ func Delete(ctx context.Context, client databroker.DataBrokerServiceClient, sess
|
||||||
Type: any.GetTypeUrl(),
|
Type: any.GetTypeUrl(),
|
||||||
Id: sessionID,
|
Id: sessionID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
return err
|
||||||
return fmt.Errorf("error deleting session: %w", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get gets a session from the databroker.
|
// Get gets a session from the databroker.
|
||||||
|
@ -35,7 +32,7 @@ func Get(ctx context.Context, client databroker.DataBrokerServiceClient, session
|
||||||
Id: sessionID,
|
Id: sessionID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error getting session from databroker: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var s Session
|
var s Session
|
||||||
|
@ -54,10 +51,7 @@ func Set(ctx context.Context, client databroker.DataBrokerServiceClient, s *Sess
|
||||||
Id: s.Id,
|
Id: s.Id,
|
||||||
Data: any,
|
Data: any,
|
||||||
})
|
})
|
||||||
if err != nil {
|
return res, err
|
||||||
return nil, fmt.Errorf("error setting session in databroker: %w", err)
|
|
||||||
}
|
|
||||||
return res, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddClaims adds the flattened claims to the session.
|
// AddClaims adds the flattened claims to the session.
|
||||||
|
|
|
@ -21,7 +21,7 @@ func Get(ctx context.Context, client databroker.DataBrokerServiceClient, userID
|
||||||
Id: userID,
|
Id: userID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error getting user from databroker: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var u User
|
var u User
|
||||||
|
@ -41,7 +41,7 @@ func Set(ctx context.Context, client databroker.DataBrokerServiceClient, u *User
|
||||||
Data: any,
|
Data: any,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error setting user in databroker: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
return res.GetRecord(), nil
|
return res.GetRecord(), nil
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ func SetServiceAccount(ctx context.Context, client databroker.DataBrokerServiceC
|
||||||
Data: any,
|
Data: any,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error setting service account in databroker: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
return res.GetRecord(), nil
|
return res.GetRecord(), nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue