fix: error handling

This commit is contained in:
sriramveeraghanta
2025-07-30 17:10:08 +05:30
parent 6a54a07cee
commit cdb488f864
2 changed files with 3 additions and 9 deletions

View File

@@ -198,9 +198,3 @@ export class HocusPocusServerManager {
HocusPocusServerManager.instance = null;
}
}
// Legacy function for backward compatibility
export const getHocusPocusServer = async (): Promise<Hocuspocus> => {
const manager = HocusPocusServerManager.getInstance();
return await manager.initialize();
};

View File

@@ -35,14 +35,14 @@ export class Server {
.then(() => {
logger.info("Redis setup completed");
const manager = HocusPocusServerManager.getInstance();
manager.initialize().catch(() => {
manager.initialize().catch((error) => {
logger.error("Failed to initialize HocusPocusServer:");
process.exit(1);
throw error;
});
})
.catch((error) => {
logger.error("Failed to setup Redis:", error);
process.exit(1);
throw error;
});
}