Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-handler): fixes async handler functions throwing errors #394

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Apr 4, 2022

  1. fix(runtime-handler): fixes async handler functions thrownin

    g errors
    
    When a Twilio Function deemed an async function throws an error, the
    handler doesn't catch it and instead throws an unhandled promise
    rejection error.
    
    Also, when constructing the context and the checks for valid account
    sids and auth tokens in the getTwilioClient function, we say that it
    should print the error. However, passing the logger to the context
    serializes and deserialises it, since it is being passed to another
    process, and and it is no longer an instance of Logger. This causes
    another error, trying to call  on the logger's error function that no
    longer exists.
    
    So, this PR does 2 things, it checks the handler function to see if it
    is an async function and calls it with await so that it can catch the
    error. And it sets shouldPrintMessage to true only if there is a logger
    object that has an error function.
    philnash committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    16a6ea2 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2024

  1. Configuration menu
    Copy the full SHA
    09612e7 View commit details
    Browse the repository at this point in the history