[Dev] Silence some errors (#2543)
This commit is contained in:
parent
d64afd5a4f
commit
f3c45689b2
@ -226,7 +226,7 @@ export function toggleGroupCallStartSubscription({
|
||||
return invokeRequest(new GramJs.phone.ToggleGroupCallStartSubscription({
|
||||
call: buildInputGroupCall(call),
|
||||
subscribed,
|
||||
}), true);
|
||||
}), true, undefined, undefined, undefined, true);
|
||||
}
|
||||
|
||||
export function leaveGroupCallPresentation({
|
||||
|
||||
@ -192,6 +192,7 @@ export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
shouldThrow?: boolean,
|
||||
shouldIgnoreUpdates?: undefined,
|
||||
dcId?: number,
|
||||
shouldIgnoreErrors?: boolean,
|
||||
): Promise<true | undefined>;
|
||||
|
||||
export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
@ -200,6 +201,7 @@ export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
shouldThrow?: boolean,
|
||||
shouldIgnoreUpdates?: boolean,
|
||||
dcId?: number,
|
||||
shouldIgnoreErrors?: boolean,
|
||||
): Promise<T['__response'] | undefined>;
|
||||
|
||||
export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
@ -208,6 +210,7 @@ export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
shouldThrow = false,
|
||||
shouldIgnoreUpdates = false,
|
||||
dcId?: number,
|
||||
shouldIgnoreErrors = false,
|
||||
) {
|
||||
if (!isConnected) {
|
||||
if (DEBUG) {
|
||||
@ -234,6 +237,7 @@ export async function invokeRequest<T extends GramJs.AnyRequest>(
|
||||
|
||||
return shouldReturnTrue ? result && true : result;
|
||||
} catch (err: any) {
|
||||
if (shouldIgnoreErrors) return undefined;
|
||||
if (DEBUG) {
|
||||
log('INVOKE ERROR', request.className);
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
@ -1374,7 +1374,7 @@ export async function fetchSendAs({
|
||||
}) {
|
||||
const result = await invokeRequest(new GramJs.channels.GetSendAs({
|
||||
peer: buildInputPeer(chat.id, chat.accessHash),
|
||||
}));
|
||||
}), undefined, undefined, undefined, undefined, true);
|
||||
|
||||
if (!result) {
|
||||
return undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user