Skip to content

Commit

Permalink
docs: formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 23, 2024
1 parent 4bde011 commit 3eece94
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ As you can see in the following screenshots, the error presented by Youch is a l
<tbody>
<tr>
<td>
<strong>Raw stack trace</strong>
<strong>Unformatted stack trace</strong>
</td>
</tr>
<tr>
Expand All @@ -53,7 +53,7 @@ As you can see in the following screenshots, the error presented by Youch is a l
</tr>
<tr>
<td>
<strong>Youch Output</strong>
<strong>Youch output</strong>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -165,6 +165,8 @@ The top-most section displays the Error info, which includes:

</details>

---

### Stack trace

The Stack trace section displays individual frames as accordion sections. Clicking on the section title reveals the frame source code. The source code is unavailable for native stack frames that are part of the Node.js, Deno, and Bun internals.
Expand All @@ -176,6 +178,8 @@ The Stack trace section displays individual frames as accordion sections. Clicki

</details>

---

For the ANSI output, only the first frame from the application code is expanded to show the source code.

<details>
Expand All @@ -185,6 +189,8 @@ For the ANSI output, only the first frame from the application code is expanded

</details>

---

### Raw output

Clicking the `Raw` button displays the Error object in its raw form, with all the error properties (not just the stack trace).
Expand All @@ -198,6 +204,8 @@ The raw output may be helpful for errors that contain additional properties. HTT

</details>

---

In case of ANSI output, you can view the raw output using the `YOUCH_RAW` environment variable. For example: `YOUCH_RAW=true node your-script.js`.

<details>
Expand All @@ -207,6 +215,8 @@ In case of ANSI output, you can view the raw output using the `YOUCH_RAW` enviro

</details>

---

### Error cause

[Error cause](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) is a standard way to bubble errors while wrapping them within a generic error. Youch displays the error cause as an interactive property within its own section.
Expand All @@ -218,6 +228,8 @@ In case of ANSI output, you can view the raw output using the `YOUCH_RAW` enviro

</details>

---

For the ANSI output, the nested properties are shown upto the two levels deep. However, you can adjust the depth using the `YOUCH_CAUSE` environment variable. For example: `YOUCH_CAUSE=4 node your-script.js`.

<details>
Expand All @@ -227,6 +239,8 @@ For the ANSI output, the nested properties are shown upto the two levels deep. H

</details>

---

### Metadata (HTML only)

Metadata refers to any additional data that you want to display on the error page. It could be the HTTP request headers, the logged-in user info, or the list of available application routes.
Expand Down

0 comments on commit 3eece94

Please sign in to comment.