Skip to content

Commit

Permalink
fix: handle strings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
enricodeleo committed Jul 1, 2022
1 parent c36a3eb commit 395b42a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export default async function (PinoAibrakeOptions: PinoAibrakeOptions) {

return build(async function (source) {
for await (const obj of source) {
const error = obj?.err;
const stack = error?.stack;
const errorMessage = new Error(error?.message || error);
const stack = obj?.err?.stack;
const errorMessage = obj?.err?.message;
const level = obj.level;

// Filter by severity (ignore errors below level x)
Expand Down

0 comments on commit 395b42a

Please sign in to comment.