error-handling-stack-traces
Error Handling Stack Traces
Last updated 4 months ago by mikeludemann .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install error-handling-stack-traces 
SYNC missed versions from official npm registry.

error-handling-stack-traces

A simple helpful small library to parse and handle the error stack traces

Information

Supported for different browsers and platforms:

  • Firefox
  • Chrome
  • Edge
  • Internet Explorer (IE)
  • Node
  • ...

Usage

Install the errors-handling-stack-traces package via manager.

Actual we use only npm.

npm install errors-handling-stack-traces

Example code:

import { parsingErrorStackTraces } from 'errors-handling-stack-traces';

function foobar() {
  throw new Error('fail');
}

try {
  foobar();
} catch (error) {
  const parsing = parsingErrorStackTraces(error.stack);
  console.log(parsing);
} finally {
  console.log("End of these code.");
}

  // Logs:
  // [
  //   {
  //     line: 4,
  //     column: 8,
  //     type: '',
  //     name: 'foobar',
  //     raw: '    at foo (/my-project/foo.ts:4:8)'
  //   },
  // ]

Note:

The type will be the string. If the string "native", then native code execution was detected.

License

MIT

See the license file

Current Tags

  • 1.0.2                                ...           latest (4 months ago)

3 Versions

  • 1.0.2                                ...           4 months ago
  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |