You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if pgError.Code == "23505" {
errMessage := "user with the same email already exists"
return errors.New(errMessage)
}
return errors.New(pgError.Message)
Can someone help me understand why?
Basically the conversion of err to pgconn.PGError does not work in the unit test, but it does work when I hit my service from the API layer.
The text was updated successfully, but these errors were encountered:
I'm trying to unit test a scenario where I get a duplicate key error but am not able to do the same.
service.go
service_test.go
My unit test doesn't cover the lines:
Can someone help me understand why?
Basically the conversion of
err
topgconn.PGError
does not work in the unit test, but it does work when I hit my service from the API layer.The text was updated successfully, but these errors were encountered: