Don't log errors for known app password issues in chat

This commit is contained in:
Eric Bailey
2025-10-23 11:10:07 -05:00
parent d4d5d6d8b9
commit 601468fe3d
3 changed files with 24 additions and 9 deletions
+9
View File
@@ -1,3 +1,4 @@
import {XRPCError} from '@atproto/xrpc'
import {t} from '@lingui/macro'
export function cleanError(str: any): string {
@@ -43,3 +44,11 @@ export function isNetworkError(e: unknown) {
}
return false
}
export function isErrorMaybeAppPasswordPermissions(e: unknown) {
if (e instanceof XRPCError && e.error === 'TokenInvalid') {
return true
}
const str = String(e)
return str.includes('Bad token scope') || str.includes('Bad token method')
}