Don't log errors for known app password issues in chat
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user