{"record":{"id":"137b98a29387b688","repo":"gitroomhq/postiz-app","slug":"handleerror-value","errorCode":null,"errorMessage":"${handleError.value}","messagePattern":"\\$\\{handleError\\.value\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts","lineNumber":278,"sourceCode":"    }\n\n    const postUrl =\n      postType === 'timeline'\n        ? `${this.meweHost}/api/dev/me/post`\n        : `${this.meweHost}/api/dev/group/${groupId}/post`;\n\n    // MeWe post endpoint may return 204 (no content), so use raw fetch\n    const postResponse = await fetch(postUrl, {\n      method: 'POST',\n      headers: this.authHeaders(accessToken),\n      body: JSON.stringify(postBody),\n    });\n\n    if (!postResponse.ok) {\n      const errorText = await postResponse.text();\n      const handleError = this.handleErrors(errorText);\n      if (handleError) {\n        throw new Error(handleError.value);\n      }\n      throw new Error('Failed to create MeWe post');\n    }\n\n    const postId = makeId(12);\n\n    const releaseURL = postType === 'timeline' ? `https://mewe.com/${integration.profile}/posts` : `https://mewe.com/group/${firstPost.settings.group}`;\n\n    return [\n      {\n        id: firstPost.id,\n        postId,\n        releaseURL,\n        status: 'success',\n      },\n    ];\n  }\n}","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts#L260-L296","documentation":"MeWe post creation returned a non-ok response and handleErrors recognized the error body, so this Error rethrows MeWe's mapped error message (handleError.value). This is a translated MeWe API error (e.g. session expired, group restriction) surfaced to the user.","triggerScenarios":"POST to MeWe's post-creation endpoint fails with a body matching a known error pattern in this.handleErrors().","commonSituations":"Expired auth/session, posting to a group the account left, rate limiting, or content policy rejection by MeWe.","solutions":["Read the thrown message — it is MeWe's own error text","Re-authenticate the MeWe integration if session-related","Verify membership/permissions for the target group","Retry after a delay if rate-limited"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if ((e as Error).message === mappedValue) { /* handle known MeWe error */ } }","preventionTips":["Keep auth cookies fresh","Handle mapped error values from handleErrors explicitly"],"tags":["mewe","post-creation","unofficial-api"],"backgroundTag":"social-post-rejected","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}