[Dev] Silence some errors (#2543)

This commit is contained in:
Alexander Zinchuk 2023-02-08 13:48:42 +01:00
parent d64afd5a4f
commit f3c45689b2
3 changed files with 6 additions and 2 deletions

View File

@ -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({

View File

@ -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

View File

@ -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;