Skip to content

Commit

Permalink
fix: not log error in multi line
Browse files Browse the repository at this point in the history
  • Loading branch information
zzswang committed Nov 15, 2018
1 parent 4346665 commit 343c1b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"delegates": "^1.0.0",
"koa-compose": "^4.1.0",
"only": "^0.0.2",
"serialize-error": "^3.0.0",
"shortid": "^2.2.12"
}
}
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import util from "util";
import compose from "koa-compose";
import Debugger from "debug";
import only from "only";
import serializeError from "serialize-error";

import Session from "./session";
import Context from "./context";
Expand Down Expand Up @@ -172,10 +173,7 @@ export default class Application extends Emitter {

if (this.silent) return;

const msg = err.stack || err.toString();
console.error();
console.error(msg.replace(/^/gm, " "));
console.error();
console.error(serializeError(err));
}

/**
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6136,6 +6136,10 @@ [email protected]:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"

serialize-error@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-3.0.0.tgz#80100282b09be33c611536f50033481cb9cc87cf"

set-blocking@^2.0.0, set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
Expand Down

0 comments on commit 343c1b9

Please sign in to comment.