( error: unknown, )
| 154 | } |
| 155 | |
| 156 | export const getFreeModeUnavailableErrorMessage = ( |
| 157 | error: unknown, |
| 158 | ): string => { |
| 159 | const details = getCliApiErrorDetails(error) |
| 160 | const block = getCountryBlockFromFreeModeError(error) |
| 161 | if (block?.countryBlockReason === 'anonymous_network') { |
| 162 | return `${IS_FREEBUFF ? 'Freebuff' : 'Free mode'} cannot be used from ${formatFreebuffHardBlockedPrivacySignals( |
| 163 | block.ipPrivacySignals, |
| 164 | )} traffic. Please disable it and try again.` |
| 165 | } |
| 166 | return details.message ?? FREE_MODE_UNAVAILABLE_MESSAGE |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Freebuff waiting-room gate errors returned by /api/v1/chat/completions. |
no test coverage detected