Skip to content

Commit

Permalink
note about createReport
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 5, 2023
1 parent 21359b8 commit b65c2ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lang/errors/createReport.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Report, ReportEntry } from "./Report"

export function createReport(error: unknown, entry: ReportEntry): Report {
// NOTE We put the most recent report entry at the end,
// because the end is closer to user's terminal output.

if (error instanceof Report) {
error.entries.push(entry)
return error
Expand Down

0 comments on commit b65c2ec

Please sign in to comment.