Implement error handling and adjust import paths
This commit introduces error handling in the 'database-webhook-handler.service.ts' to log and rethrow errors when processing webhooks. It also adjusts the import paths for ContentlayerClient and WordpressClient in 'create-cms-client.ts'. Method names in 'database-webhook-router.service.ts' have been updated for clarity.
This commit is contained in:
@@ -19,18 +19,18 @@ export async function createCmsClient(
|
||||
return getWordpressClient();
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown CMS type: ${type}`);
|
||||
throw new Error(`Unknown CMS type`);
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentLayerClient() {
|
||||
const { ContentlayerClient } = await import('../../contentlayer');
|
||||
const { ContentlayerClient } = await import('../../contentlayer/src/client');
|
||||
|
||||
return new ContentlayerClient();
|
||||
}
|
||||
|
||||
async function getWordpressClient() {
|
||||
const { WordpressClient } = await import('../../wordpress');
|
||||
const { WordpressClient } = await import('../../wordpress/src/wp-client');
|
||||
|
||||
return new WordpressClient();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user