From fc643aeb3628830b07d4f4891e3ff9b16bae54da Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Sun, 24 May 2026 17:52:04 +0300 Subject: [PATCH] fix: handle 403 api_forecasting_not_enabled in metaculus Fixes #515 --- core/src/exchanges/metaculus/errors.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/exchanges/metaculus/errors.ts b/core/src/exchanges/metaculus/errors.ts index f2143ea3..1165beb6 100644 --- a/core/src/exchanges/metaculus/errors.ts +++ b/core/src/exchanges/metaculus/errors.ts @@ -76,6 +76,14 @@ export class MetaculusErrorMapper extends ErrorMapper { this.exchangeName, ); } + // Feature-gated 403: API forecasting not enabled for the account + if (lower.includes('api_forecasting_not_enabled')) { + return new PermissionDenied( + 'Metaculus API forecasting is not enabled for your account. ' + + 'Visit your Metaculus account settings to enable it, or contact Metaculus support.', + this.exchangeName, + ); + } return new PermissionDenied( 'You do not have permission for this operation. ' + 'Check your Metaculus account permissions and API token scope.',