fix: 错误捕捉

This commit is contained in:
ilhamtahir committed 2024-11-17 15:33:06 +08:00
1 parent 2ca39b3777
commit 4742e2013d
1 file changed
+4
+4
View File
@@ -26,6 +26,7 @@ export class UserService {
}
async createInitialUser() {
try {
const existingUser = await this.userRepository.findOne({
where: { username: 'admin' },
});
@@ -45,5 +46,8 @@ export class UserService {
} else {
console.log('Admin user already exists');
}
} catch (error) {
console.log('Error creating initial user', error);
}
}
}