Skip to content

But don't take away exception handling! #52

@jakebiesinger-onduo

Description

@jakebiesinger-onduo

Howdy!

I love the idea of this repository. We have tons of GCP Cloud Functions and Cloud Runs (what an awful noun). It can be hard for a dev to switch between the two, particularly to go to Cloud Run land when they've never seen a Dockerfile before.

But we're moving more and more of our stuff into Cloud Run because it offers better options for handling exceptions. Many of these are super-duper simple functions and Cloud Run feels like overkill, just to allow me to specify how we should handle those exceptions.

I realize this is more like a feature request for Cloud Functions, but consider how easy you could make this for everyone:

def entrypoint_do_thing(request):
  if request.args['foo'] == 'bar:
    return 'some_data', 200
  else:
    raise BadnessError()

@functions_framework.error_handler(BadnessError)
def handle_badness(e):
  return 'badness happened', 400

Something like the above would be simple and familiar for lots of folks since it looks like Flask error handling, but you still wouldn't have to expose the underlying Flask app to the world.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions