Home / Function/ normalizeErrorMessage() — react Function Reference

normalizeErrorMessage() — react Function Reference

Architecture documentation for the normalizeErrorMessage() function in toThrow.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b62329d2_74ab_b4ab_9532_d227726255c1["normalizeErrorMessage()"]
  fe04fd9d_a160_617f_17c2_8cee445cef37["toThrow.js"]
  b62329d2_74ab_b4ab_9532_d227726255c1 -->|defined in| fe04fd9d_a160_617f_17c2_8cee445cef37
  774fdc94_8110_ae0c_ac38_e3d55fadaa1d["toThrow()"]
  774fdc94_8110_ae0c_ac38_e3d55fadaa1d -->|calls| b62329d2_74ab_b4ab_9532_d227726255c1
  style b62329d2_74ab_b4ab_9532_d227726255c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/jest/matchers/toThrow.js lines 27–36

function normalizeErrorMessage(message) {
  if (newErrorFormat) {
    const match = message.match(regex);
    if (match) {
      return `Cannot read properties of ${match[2]} (reading '${match[1]}')`;
    }
  }

  return message;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does normalizeErrorMessage() do?
normalizeErrorMessage() is a function in the react codebase, defined in scripts/jest/matchers/toThrow.js.
Where is normalizeErrorMessage() defined?
normalizeErrorMessage() is defined in scripts/jest/matchers/toThrow.js at line 27.
What calls normalizeErrorMessage()?
normalizeErrorMessage() is called by 1 function(s): toThrow.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free