--- id: javascript-error-object title: "JavaScript Error Object" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["Error object", "error reference", "err.name", "err.message", "error names"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.87 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["javascript", "js", "web", "frontend", "w3schools", "errors", "error-object"] raw_sources: ["https://www.w3schools.com/js/js_error_object.asp"] applied_in: [] github_commit: "" --- # [[JavaScript Error Object]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) JavaScript's built-in Error object carries information when an error occurs, exposing useful properties such as `name` and `message`, with `name` returning one of six standard error types. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **The Error object** is built in and provides information when errors occur, with useful properties like `name` and `message`. [S1] - **`Error.isError(x)`** returns true if a value is an Error. [S1] - **Six error names** β€” the `name` property can return `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError`. [S1] - **EvalError is deprecated** β€” use `SyntaxError` instead. [S1] - **Avoid non-standard members** β€” several properties and methods are browser-specific or outdated and should not be used. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Read `name` to branch on error type** β€” the standardized set of six error names lets handling code distinguish what went wrong. [S1] - **Stick to standard members** β€” rely on `name`, `message`, and `cause`; avoid deprecated/non-standard properties and methods. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **The Error Object** JavaScript includes a built-in error object providing information when errors occur, with useful properties like `name` and `message`. [S1] **Error Object Methods & Properties** [S1] | Property / Method | Description | |-------------------|-------------| | `new Error()` | Creates a new Error object | | `name` | Sets or returns an error name | | `message` | Sets or returns an error message | | `cause` | Sets or returns an error cause | | `Error.isError(x)` | Returns true if a value (x) is an Error | **Error Names** The `name` property can return one of six error types: [S1] | Error Name | Description | |------------|-------------| | `EvalError` | Deprecated - use SyntaxError instead | | `RangeError` | A number "out of range" has occurred | | `ReferenceError` | An illegal reference has occurred | | `SyntaxError` | A syntax error has occurred | | `TypeError` | A type error has occurred | | `URIError` | An error in encodeURI() has occurred | Each error name has an associated "Try it" button linking to examples. No inline code examples are displayed on this reference page. [S1] **Non-Standard Properties and Methods** The page warns against using deprecated, browser-specific, or outdated members: [S1] - **Properties:** `arguments`, `caller`, `columnNumber`, `description`, `displayName`, `fileName`, `lineNumber`, `number`, `stack` - **Methods:** `evalError()`, `internalError()`, `toSource()` ## πŸ› οΈ 적용 사둀 (Applied in summary) This is a reference page; the source displays no inline code examples (only "Try it" links). The applicable usage is reading `err.name` / `err.message` inside a `catch` block, as shown on the related Error Statements page. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Not found in source as displayed inline code; the reference page exposes only the property/method and error-name tables above and links to external "Try it" examples. The canonical access pattern (drawn from the same family of pages) is reading the standard properties: ```javascript try { // ... } catch(err) { let name = err.name; // e.g. "TypeError" let message = err.message; // human-readable description } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **EvalError deprecation** β€” the source marks `EvalError` as deprecated in favor of `SyntaxError`. [S1] - **Non-standard members** β€” listed properties/methods are flagged as browser-specific or outdated and should be avoided. [S1] ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.87 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[JavaScript Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[JavaScript Errors Intro]], [[JavaScript Error Statements]], [[JavaScript Silent Errors]], [[JavaScript Debugging]] - **μ°Έμ‘° λ§₯락:** The reference for the object received in a `catch` block and the standardized error names used to identify failures. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” JavaScript Error Object β€” https://www.w3schools.com/js/js_error_object.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Error Object" page (Astra wiki-curation, P-Reinforce v3.1 format).