Skip to content Navigation Menu Toggle navigation Sign in Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests... Search Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Saved searches Use saved searches to filter your results more quickly Name Query To see all available qualifiers, see our documentation. Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Uh oh! There was an error while loading. Please reload this page. parse-community / parse-server Public Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 4.8k Star 21.4k Code Issues 372 Pull requests 131 Actions Projects Wiki Security and quality 118 Insights Additional navigation options Code Issues Pull requests Actions Projects Wiki Security and quality Insights FilesExpand file tree alphaBreadcrumbsparse-server/src/Error.jsCopy pathBlameMore file actionsBlameMore file actions Latest commit HistoryHistoryHistory46 lines (41 loc) · 1.95 KB alphaBreadcrumbsparse-server/src/Error.jsCopy pathTopFile metadata and controlsCodeBlame46 lines (41 loc) · 1.95 KBRawCopy raw fileDownload raw fileOpen symbols panelEdit and raw actions12345678910111213141516171819202122232425262728293031323334353637383940414243444546import defaultLogger from './logger'; /** * Creates a sanitized error that hides detailed information from clients * while logging the detailed message server-side. * * @param {number} errorCode - The Parse.Error code (e.g., Parse.Error.OPERATION_FORBIDDEN) * @param {string} detailedMessage - The detailed error message to log server-side * @param {object} config - Parse Server config with enableSanitizedErrorResponse * @param {string} [sanitizedMessage='Permission denied'] - The sanitized message to return to clients * @returns {Parse.Error} A Parse.Error with sanitized message */function createSanitizedError(errorCode, detailedMessage, config, sanitizedMessage = 'Permission denied') { // On testing we need to add a prefix to the message to allow to find the correct call in the TestUtils.js file if (process.env.TESTING) { defaultLogger.error('Sanitized error:', detailedMessage); } else { defaultLogger.error(detailedMessage); } return new Parse.Error(errorCode, config?.enableSanitizedErrorResponse !== false ? sanitizedMessage : detailedMessage);} /** * Creates a sanitized error from a regular Error object * Used for non-Parse.Error errors (e.g., Express errors) * * @param {number} statusCode - HTTP status code (e.g., 403) * @param {string} detailedMessage - The detailed error message to log server-side * @returns {Error} An Error with sanitized message */function createSanitizedHttpError(statusCode, detailedMessage, config) { // On testing we need to add a prefix to the message to allow to find the correct call in the TestUtils.js file if (process.env.TESTING) { defaultLogger.error('Sanitized error:', detailedMessage); } else { defaultLogger.error(detailedMessage); } const error = new Error(); error.status = statusCode; error.message = config?.enableSanitizedErrorResponse !== false ? 'Permission denied' : detailedMessage; return error;} export { createSanitizedError, createSanitizedHttpError }; You can’t perform that action at this time.