AddError appends a recorded error item to a session at the next position.
(_ context.Context, sessionID string, e *Error)
| 344 | |
| 345 | // AddError appends a recorded error item to a session at the next position. |
| 346 | func (s *InMemorySessionStore) AddError(_ context.Context, sessionID string, e *Error) error { |
| 347 | if sessionID == "" { |
| 348 | return ErrEmptyID |
| 349 | } |
| 350 | session, exists := s.sessions.Load(sessionID) |
| 351 | if !exists { |
| 352 | return ErrNotFound |
| 353 | } |
| 354 | errCopy := *e |
| 355 | session.AddError(&errCopy) |
| 356 | return nil |
| 357 | } |
| 358 | |
| 359 | // querier is an interface that abstracts *sql.DB and *sql.Tx for query operations. |
| 360 | type querier interface { |