File tree 1 file changed +14
-2
lines changed
src/services/clients/claude
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export class Claude {
188
188
async init ( ) {
189
189
const organizations = await this . getOrganizations ( )
190
190
if ( organizations . error ) {
191
- throw new Error ( JSON . stringify ( organizations , null , 2 ) )
191
+ throw new Error ( organizations . error )
192
192
}
193
193
this . organizationId = organizations [ 0 ] . uuid
194
194
this . recent_conversations = await this . getConversations ( )
@@ -222,7 +222,19 @@ export class Claude {
222
222
cookie : `sessionKey=${ this . sessionKey } ` ,
223
223
} ,
224
224
} )
225
- return await response . json ( ) . catch ( errorHandle ( 'getOrganizations' ) )
225
+ const responseText = await response . text ( )
226
+ if ( responseText . includes ( 'available in certain regions' ) )
227
+ return {
228
+ error : 'Claude.ai is not available in your region' ,
229
+ }
230
+ try {
231
+ return JSON . parse ( responseText )
232
+ } catch ( e ) {
233
+ errorHandle ( 'getOrganizations' ) ( e )
234
+ return {
235
+ error : 'failed to parse response' ,
236
+ }
237
+ }
226
238
}
227
239
/**
228
240
* Delete all conversations
You can’t perform that action at this time.
0 commit comments