Code Monkey home page Code Monkey logo

Comments (5)

sloev avatar sloev commented on May 27, 2024

Lambdarest was made with our stack in focus, we use Cloudwatch and therefore i chose to catch and log instead of elevating exceptions since that would lay off responsibility of replies to Amazon Api Gateway. In general i wanted as much control in my lambda as possible.

But that could be solved by using the pattern flaskand connexion is using (if i remember correctly) of specifying the errorhandler during initialization of lambda_handler.

We could:

lambda_handler = create_lambda_handler(error_handler=None)

Here lambda_handler would raise all errors.

What do you think?

from python-lambdarest.

simongarnier avatar simongarnier commented on May 27, 2024

Great idea! If I understand correctly, the create_lambda_handler() function would have a default error_handler to replicates the behavior of the old exception handling. If set to None, we would just raise the exception.

I implemented this here.

from python-lambdarest.

sloev avatar sloev commented on May 27, 2024

Awesome, exactly! and i find the solution just as i would have written it. Great work!
I have some feedback (relayed from review of PR):
Can you:
bump the version number in init.py and setup.py to 2.2.6 and write an entry in HISTORY about the change ?

kind regards
Johannes Valbjorn

from python-lambdarest.

sloev avatar sloev commented on May 27, 2024

thanks, i should have created some guidelines mentioning the manual version stuff.

Merged

from python-lambdarest.

jacksgt avatar jacksgt commented on May 27, 2024

Hi, there I had the same problem and just stumbled across this issue. I agree with the default behavior, because it makes it very easy to get started. However, I think this behavior is worth mentioning in the README, since I had to spend quite some time to figure our why my except block was not being executed.
I will contribute a PR in the next few days.

from python-lambdarest.

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.