import { isDev } from '@shared/isDev' ; import { GraphQLError } from 'graphql' ; const dbClient = 'postgres' ; const maskedMessage = 'Something went wrong' ; export const maskSensitiveInfoFromError = ( err ) => { if ( isDev ( ) ) { return err ; } else if ( ( err instanceof GraphQLError && err . extensions ?. exception ?. client === dbClient ) || err . client === dbClient ) { return new Error ( maskedMessage ) ; } return err ; } ;