replace error instances with AppError
This commit is contained in:
1 parent
25d81f4238
commit
86eeda3f0e
3 files changed
+8
-3
No files matched your search
@@ -71,7 +71,7 @@ class MongoUsersRepository implements IUsersRepository {
|
||||
findById = async (id: string) => {
|
||||
const user = await UserModel.findById(id).select("-password").select("-profileImage");
|
||||
if (!user) {
|
||||
throw new Error("User not found");
|
||||
throw new AppError({ message: "User not found", service: SERVICE_NAME, status: 404 });
|
||||
}
|
||||
|
||||
return this.toEntity(user);
|
||||
|
||||
Reference in new issue
Block a user