There was an error while loading. Please reload this page.
2 parents 1392b11 + 26f4413 commit 0a24bb4Copy full SHA for 0a24bb4
1 file changed
apps/web/app/(ee)/api/cron/discount-codes/create/route.ts
@@ -96,6 +96,17 @@ export const POST = withCron(async ({ rawBody }) => {
96
);
97
}
98
99
+ // Eg: This application does not have the required permissions for this endpoint on account 'acct_xxx'.
100
+ // Having the 'read_write' scope would allow this request to continue.
101
+ if (
102
+ error instanceof Error &&
103
+ error.message.includes(
104
+ "This application does not have the required permissions",
105
+ )
106
+ ) {
107
+ return logAndRespond(error.message, { logLevel: "warn" });
108
+ }
109
+
110
throw error;
111
112
0 commit comments