mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove detailed logging of graphql-request-error
This commit is contained in:
parent
8bda898c82
commit
6771a4cbef
@ -2,10 +2,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
|
||||
import { GraphQLError } from 'graphql'
|
||||
import { gql } from 'graphql-request'
|
||||
|
||||
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
export async function requestGetPublicKey(
|
||||
@ -25,7 +25,6 @@ export async function requestGetPublicKey(
|
||||
}
|
||||
`
|
||||
const variables = {}
|
||||
|
||||
try {
|
||||
const { data, errors, extensions, headers, status } = await graphQLClient.rawRequest(
|
||||
query,
|
||||
@ -39,6 +38,9 @@ export async function requestGetPublicKey(
|
||||
}
|
||||
logger.warn(`requestGetPublicKey processed without response data`)
|
||||
} catch (err) {
|
||||
throw new LogError(`Request-Error:`, err)
|
||||
if (err instanceof GraphQLError) {
|
||||
logger.error(`RawRequest-Error on {} with message {}`, endpoint, err.message)
|
||||
}
|
||||
throw new Error(`Request-Error in requestGetPublicKey.`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
|
||||
import { GraphQLError } from 'graphql'
|
||||
import { gql } from 'graphql-request'
|
||||
|
||||
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
export async function requestGetPublicKey(
|
||||
@ -25,7 +25,6 @@ export async function requestGetPublicKey(
|
||||
}
|
||||
`
|
||||
const variables = {}
|
||||
|
||||
try {
|
||||
const { data, errors, extensions, headers, status } = await graphQLClient.rawRequest(
|
||||
query,
|
||||
@ -39,6 +38,9 @@ export async function requestGetPublicKey(
|
||||
}
|
||||
logger.warn(`requestGetPublicKey processed without response data`)
|
||||
} catch (err) {
|
||||
throw new LogError(`Request-Error:`, err)
|
||||
if (err instanceof GraphQLError) {
|
||||
logger.error(`RawRequest-Error on {} with message {}`, endpoint, err.message)
|
||||
}
|
||||
throw new Error(`Request-Error in requestGetPublicKey`) // :${err}`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,9 +60,7 @@ export async function validateCommunities(): Promise<void> {
|
||||
// DbCommunity.delete({ id: dbCom.id })
|
||||
}
|
||||
} catch (err) {
|
||||
if (!isLogError(err)) {
|
||||
logger.error(`Error:`, err)
|
||||
}
|
||||
logger.error(`Error:`, err)
|
||||
}
|
||||
} else {
|
||||
logger.warn(
|
||||
@ -73,10 +71,6 @@ export async function validateCommunities(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
function isLogError(err: unknown) {
|
||||
return err instanceof LogError
|
||||
}
|
||||
|
||||
async function invokeVersionedRequestGetPublicKey(
|
||||
dbCom: DbFederatedCommunity,
|
||||
): Promise<string | undefined> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user