Skip to content

Commit

Permalink
fix(mongoose): removed redundant catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristiyan Tachev committed Feb 10, 2025
1 parent 62c370c commit 11ae622
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/mongoose/src/mongodb.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ export class MongoDbModule {
providers: [
{
provide: MONGOOSE_CONNECTION_TOKEN,
useFactory: async () => {
try {
return await mongooseInstance.connect(url, options);
} catch (e) {
console.error('Unable to initialize mongodb connection');
console.error(e);
throw new Error(e);
}
},
useFactory: () => mongooseInstance.connect(url, options),
},
],
};
Expand Down

0 comments on commit 11ae622

Please sign in to comment.