MCPcopy Create free account
hub / github.com/cockroachdb/copyist / VerifyRecordWithStringArg

Method VerifyRecordWithStringArg

session.go:116–128  ·  view source on GitHub ↗

VerifyRecordWithStringArg returns one of the records in this session's recording, failing with a nice error if no such record exists, or if its first argument does not match the given string.

(recordTyp recordType, arg string)

Source from the content-addressed store, hash-verified

114// recording, failing with a nice error if no such record exists, or if its
115// first argument does not match the given string.
116func (s *session) VerifyRecordWithStringArg(recordTyp recordType, arg string) (*record, error) {
117 rec, err := s.VerifyRecord(recordTyp)
118 if err != nil {
119 return nil, err
120 }
121 if rec.Args[0].(string) != arg {
122 return nil, s.sessionErr(
123 "mismatched argument to %s, expected %s, got %s\n\n"+
124 "Do you need to regenerate the recording with the -record flag?",
125 recordTyp.String(), rec.Args[0].(string), arg)
126 }
127 return rec, nil
128}
129
130// VerifyRecord returns one of the records in this session's recording, failing
131// with a nice error if no such record exists.

Callers 3

ExecContextMethod · 0.80
PrepareContextMethod · 0.80
QueryContextMethod · 0.80

Calls 3

VerifyRecordMethod · 0.95
sessionErrMethod · 0.95
StringMethod · 0.80

Tested by

no test coverage detected