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.
This commit is contained in:
padreug 2025-09-08 14:10:27 +02:00
parent b8ba41d088
commit 8b696c406a

View file

@ -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}`)
}