feat(core): make permission and invoice offline available (#8123)
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
type GraphQLQuery,
|
||||
type QueryOptions,
|
||||
type QueryResponse,
|
||||
UserFriendlyError,
|
||||
} from '@affine/graphql';
|
||||
import { fromPromise, Service } from '@toeverything/infra';
|
||||
import type { Observable } from 'rxjs';
|
||||
@@ -39,13 +38,11 @@ export class GraphQLService extends Service {
|
||||
try {
|
||||
return await this.rawGql(options);
|
||||
} catch (err) {
|
||||
const standardError = UserFriendlyError.fromAnyError(err);
|
||||
|
||||
if (standardError.status === 403) {
|
||||
if (err instanceof BackendError && err.status === 403) {
|
||||
this.framework.get(AuthService).session.revalidate();
|
||||
}
|
||||
|
||||
throw new BackendError(standardError);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user