Skip to content

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

fix: map more errors

Nevo Davide1a7b19b4876
diff --git a/libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts b/libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts
index 8239340d9..3ed823af6 100644
--- a/libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts
@@ -8,6 +8,7 @@ import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
import { SocialAbstract } from '@gitroom/nestjs-libraries/integrations/social.abstract';
import dayjs from 'dayjs';
import { Integration } from '@prisma/client';
+import { number, string } from 'yup';
export class MastodonProvider extends SocialAbstract implements SocialProvider {
override maxConcurrentJob = 5; // Mastodon instances typically have generous limits
diff --git a/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts b/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts
index 799d3e089..0f7c0ef3e 100644
--- a/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts
@@ -87,7 +87,7 @@ export class PinterestProvider
public override handleErrors(body: string):
| {
- type: 'refresh-token' | 'bad-body';
+ type: 'refresh-token' | 'bad-body' | 'retry';
value: string;
}
| undefined {
@@ -97,6 +97,12 @@ export class PinterestProvider
value: 'You can upload a maximum of 5 images per post on Pinterest.',
};
}
+ if (body.indexOf('Unable to reach the URL') > -1) {
+ return {
+ type: 'retry' as const,
+ value: 'Pinterest was unable to reach the URL provided. Please check the link and try again.',
+ }
+ }
if (body.indexOf('Board not found') > -1) {
return {
type: 'bad-body' as const,