8000 Strict Mode / Better Errors when dependency is missing · Issue #796 · ets-labs/python-dependency-injector · GitHub
[go: up one dir, main page]

Skip to content
Strict Mode / Better Errors when dependency is missing #796
Open
@genixpro

Description

@genixpro

I've been using this library for a while, and its great. I am often using strings to reference my dependencies, e.g. Provide['stuff']. And I have different application containers that support different configurations of applications.

Right now, if I forget a key dependency for a specific container, I end up getting an error that looks like this:

AttributeError: 'Provide' object has no attribute 'get_by_user_id'

This is because DI could not find the dependency. I would rather that the DI framework itself just threw a more descriptive error, e.g. "XYZ Dependency Not Found"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0