Skip to content

Surface a broken ju at app build time, not per request #8

Closed

Description

@thorwhalen

Follow-up from the adversarial review of #6.

After #6, a broken ju install (e.g. a missing dependency of ju) raises instead of silently degrading. But FunctionSpecStore generates specs lazily, so mk_rjsf_app still builds successfully and every request (including / and /api/functions) then returns 500 with the import error, and routes.py converts it to JSON without the traceback.

Suggested: resolve _import_func_to_form_spec() once when the store or app is constructed, so a broken environment fails at startup with a full traceback.

Cosmetic, same area: JuNotInstalledWarning uses stacklevel=4, which assumes access through __getitem__. Through Mapping.get / .items() (used by routes.py) it is attributed to <frozen _collections_abc>. Resolving at construction time fixes that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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