Giter VIP home page Giter VIP logo

Comments (5)

karthikeyanjp avatar karthikeyanjp commented on September 8, 2024

I would like to contribute. Will submit a PR with the regex and unit tests.

from aws-lambda-powertools-typescript.

dreamorosi avatar dreamorosi commented on September 8, 2024

Hi @karthikeyanjp, thank you for reaching out.

I'll assign the issue to you and help merge the PR once ready.

from aws-lambda-powertools-typescript.

karthikeyanjp avatar karthikeyanjp commented on September 8, 2024

Referring to format of error locations as mentioned in https://nodejs.org/api/errors.html#errorstack & https://v8.dev/docs/stack-trace-api , we can support the following pattern:

  1. plain-filename.js:line:column or /absolute/path/to/file.js:line:column or <transport-protocol>:///url/to/module/file.mjs:line:column wrapped in ().
  2. location with multiple colon. Example at Script.runInThisContext (node:vm:130:12)
  3. location from an eval statement.
    Example:
Error: unknown:
at eval (eval at <anonymous> (file:///home/foo/bar/some-file.ts:1:35), <anonymous>:1:7)
at <anonymous> (/home/foo/bar/file-that-threw-the-error.ts:52:3)

For pattern (3), the current & above proposed regex will extact eval at <anonymous> (file:///home/foo/bar/some-file.ts:1:35), <anonymous>:1) instead of /home/foo/bar/file-that-threw-the-error.ts:52: as there are two nested locations embedded within ().

I am proposing the regex /\(([^)]*?):(\d+):(\d+)\)\\?$/ . I tested and it works for all the cases.

Submitted PR #2194 .

@dreamorosi please let me know your thoughts on the new regex.

from aws-lambda-powertools-typescript.

github-actions avatar github-actions commented on September 8, 2024

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

from aws-lambda-powertools-typescript.

github-actions avatar github-actions commented on September 8, 2024

This is now released under v2.0.3 version!

from aws-lambda-powertools-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.