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:
parent
b8ba41d088
commit
8b696c406a
1 changed files with 5 additions and 0 deletions
|
|
@ -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}`)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue