Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: wordpress insufficent permission

Nevo Davidf7d36b36e75a
diff --git a/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts b/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts
index 84d199195..a1094e3af 100644
--- a/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts
@@ -13,6 +13,7 @@ import slugify from 'slugify';
// import FormData from 'form-data';
import axios from 'axios';
import { Tool } from '@gitroom/nestjs-libraries/integrations/tool.decorator';
+import { string } from 'yup';
export class WordpressProvider
extends SocialAbstract
@@ -49,6 +50,19 @@ export class WordpressProvider
username: '',
};
}
+ override handleErrors(
+ body: string
+ ):
+ | { type: 'refresh-token' | 'bad-body' | 'retry'; value: string }
+ | undefined {
+ if (body.indexOf('rest_cannot_create') > -1) {
+ return {
+ type: 'bad-body',
+ value: 'The connect user has insufficient permissions to create posts',
+ };
+ }
+ return undefined;
+ }
async customFields() {
return [