Skip to content

[QUESTION] What's the best way to handle errors between apps? #17

@frabraga

Description

@frabraga

Considering the example:

# user/internal.py
from .services import UserService

def get_user():
    try:
        UserService.get_user()
    except SomeIntegrationError:
        # Do something
# artists/interfaces.py
from user.apis import UserAPI

def get_user():
    return UserAPI.get_user()

What do you guys think it's the best way to handle this situation?

I'm thinking of just raise an exception on internal.py and ignore that we should return a Json or we could return a dict with an error key and check on interfaces if that key exists and then handle the error there. But I don't like either option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions