From 8b696c406a498829bd40546cf049c6dc553cbab4 Mon Sep 17 00:00:00 2001 From: padreug Date: Mon, 8 Sep 2025 14:10:27 +0200 Subject: [PATCH] Add error handling for 403 status in NostrmarketAPI - Implement a specific error message for 403 responses, indicating that the NostrMarket extension may not be enabled for the user. - This change enhances user feedback and clarifies access issues related to the Nostrmarket service. --- src/modules/market/services/nostrmarketAPI.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/market/services/nostrmarketAPI.ts b/src/modules/market/services/nostrmarketAPI.ts index 11bfcae..4afa970 100644 --- a/src/modules/market/services/nostrmarketAPI.ts +++ b/src/modules/market/services/nostrmarketAPI.ts @@ -132,6 +132,11 @@ export class NostrmarketAPI extends BaseService { return null as T } + // If 403, likely the nostrmarket extension is not enabled for this user + if (response.status === 403) { + throw new Error(`Access denied: Please ensure the NostrMarket extension is enabled for your LNbits account. Contact your administrator if needed.`) + } + throw new Error(`NostrmarketAPI request failed: ${response.status} ${response.statusText}`) }