💻 Tech
Yesterday, I posted about mocking query transactions like FindOne. Today, I’ll share how to mock an error.
errorCode := 1001
errorMessage := "internal error"
mtest.CreateWriteErrorsResponse(mtest.WriteError{
Index: 0,
Code: errorCode,
Message: errorMessage,
}),