{"id":"2d2a56e4fa937188","repo":"jestjs/jest","slug":"error-message","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"PrettyFormatPluginError","httpStatus":null,"severity":"error","filePath":"packages/pretty-format/src/index.ts","lineNumber":335,"sourceCode":"      : plugin.print(\n          val,\n          valChild => printer(valChild, config, indentation, depth, refs),\n          str => {\n            const indentationNext = indentation + config.indent;\n            return (\n              indentationNext +\n              str.replaceAll(NEWLINE_REGEXP, `\\n${indentationNext}`)\n            );\n          },\n          {\n            edgeSpacing: config.spacingOuter,\n            min: config.min,\n            spacing: config.spacingInner,\n          },\n          config.colors,\n        );\n  } catch (error: any) {\n    throw new PrettyFormatPluginError(error.message, error.stack);\n  }\n  if (typeof printed !== 'string') {\n    throw new TypeError(\n      `pretty-format: Plugin must return type \"string\" but instead returned \"${typeof printed}\".`,\n    );\n  }\n  return printed;\n}\n\nfunction findPlugin(plugins: Plugins, val: unknown) {\n  for (const plugin of plugins) {\n    try {\n      if (plugin.test(val)) {\n        return plugin;\n      }\n    } catch (error: any) {\n      throw new PrettyFormatPluginError(error.message, error.stack);\n    }","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/jestjs/jest/blob/f49721c78e195558b40913977c9230f5b7f559d8/packages/pretty-format/src/index.ts#L317-L353","documentation":"Error \"${error.message}\" thrown in jestjs/jest.","triggerScenarios":"Thrown at packages/pretty-format/src/index.ts:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["pretty-format re-threw an error thrown by a plugin's serialize/print function. Inspect the inner error message to find the failing plugin, then fix or remove that plugin from your pretty-format configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"f49721c78e195558b40913977c9230f5b7f559d8","analyzedAt":"2026-08-03T20:16:28.571Z","schemaVersion":2}