{"record":{"id":"82624206ffa6c79e","repo":"gitroomhq/postiz-app","slug":"reddit-rejected-the-post-to-r-postdata-sr-al","errorCode":null,"errorMessage":"Reddit rejected the post to r/${postData.sr}: ${all.json.errors.map((e: any[]) => e?.[1] || e?.[0] || '').join(', ')}","messagePattern":"Reddit rejected the post to r/(.+?): (.+?)","errorType":"exception","errorClass":"BadBody","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/reddit.provider.ts","lineNumber":522,"sourceCode":"      text: data.message,\n      sr: value.subreddit.replace('/r/', '').toLowerCase(),\n    };\n\n    const all = await (\n      await this.fetch('https://oauth.reddit.com/api/submit', {\n        method: 'POST',\n        headers: {\n          Authorization: `Bearer ${accessToken}`,\n          'Content-Type': 'application/x-www-form-urlencoded',\n        },\n        body: new URLSearchParams(postData),\n      })\n    ).json();\n\n    // Reddit rejects submissions with a 200 and an errors array: surface the\n    // real reason instead of failing later with an unknown outcome.\n    if (all?.json?.errors?.length) {\n      throw new BadBody(\n        this.identifier,\n        JSON.stringify(all),\n        Buffer.from('{}'),\n        `Reddit rejected the post to r/${postData.sr}: ${all.json.errors\n          .map((e: any[]) => e?.[1] || e?.[0] || '')\n          .join(', ')}`\n      );\n    }\n\n    // Self/link posts answer with the created post directly.\n    if (all?.json?.data?.id) {\n      data.results = [\n        ...data.results,\n        {\n          postId: all.json.data.id,\n          releaseURL:\n            all.json.data.url || `https://www.reddit.com/r/${postData.sr}`,\n        },","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/reddit.provider.ts#L504-L540","documentation":"Reddit's submit endpoint returns HTTP 200 with a json.errors array when it rejects a submission (RATELIMIT, NO_TEXT, TOO_OLD, QUARANTINE, etc.). finalizePost checks this array and throws BadBody listing each error code/message so the real reason surfaces instead of a later unknown-outcome failure.","triggerScenarios":"POST to api/submit succeeds at HTTP level but all.json.errors is non-empty — posting too fast (RATELIMIT), missing/invalid fields, banned from subreddit, invalid captcha/redirect, etc.","commonSituations":"Posting repeatedly from the same account (rate limit), new accounts posting to restricted subreddits, deleted/invalid sr, or shadowbanned accounts.","solutions":["Read the error codes in the message and address the specific one (wait for RATELIMIT, fix fields for NO_TEXT/TOO_OLD)","Verify the account is allowed to post to r/{sr} (age, karma, bans)","Slow down scheduled Reddit posts to avoid RATELIMIT","Re-authenticate if the error indicates session/token problems"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!content?.trim()) throw new Error('Post text required for Reddit');","typeGuard":null,"tryCatchPattern":"catch (e) { if (/Reddit rejected the post/.test(e.message)) { const codes = e.message.match(/RATELIMIT|NO_TEXT|TOO_OLD/g); /* branch on codes */ } }","preventionTips":["Space out Reddit posts to avoid RATELIMIT","Pre-verify subreddit post permissions and account age/karma"],"tags":["reddit","post-rejected","rate-limit"],"backgroundTag":"social-post-rejected","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}