We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
We have a MongoDB dependency in the controller. You can see here: https://github.com/amitshekhariitbhu/go-backend-clean-architecture/blob/main/api/controller/task_controller.go#L8 Maybe we should consider move the code bellow to other layer:
task.ID = primitive.NewObjectID() task.UserID, err = primitive.ObjectIDFromHex(userID)
What's your thoughts?
The text was updated successfully, but these errors were encountered:
Hi @marcosvidolin
Your point is valid. A few more developers also suggested making this change. I shall do it.
Thanks
Sorry, something went wrong.
I understood your suggestion but makes me wonder how can we properly handle errors like this to not be generic InternalServerError?
Sorry for the late response here, I just found this project
I would recommend moving this code to the MongoDB repository and also suggest creating a custom error in the following manner:
task, err := primitive.ObjectIDFromHex(userID) if err != nil { return nil, ErrMyCustonIDGeneration("error message") // change the error name ;) }
No branches or pull requests
Hi,
We have a MongoDB dependency in the controller. You can see here: https://github.com/amitshekhariitbhu/go-backend-clean-architecture/blob/main/api/controller/task_controller.go#L8
Maybe we should consider move the code bellow to other layer:
What's your thoughts?
The text was updated successfully, but these errors were encountered: