create-work-request with invalid environment: help user debug the issue

If a user creates a work request:

debusine create-work-request sbuild < sbuild.txt

And sbuild.txt contains:

build_components:
- any
- all
host_architecture: amd64
input:
  source_artifact: 536
environment: debian/match:codename=trixie:variant=sbuild

If the debusine instance cannot find the environment:

  • The work request gets created (user sees success on the output of the debusine command)
  • The work request is marked as "Completed" and "Error" (as seen in https://server/work-request/500/)
  • The user cannot know what went wrong. The only help is in the debusine server's logs. Debusine server logs contains "2024-08-02 07:55:01,124 [scheduler/1701/139762290979520] WARNING: WorkRequest 501 failed to pre-process task data, aborting it. Task data: {'input': {'source_artifact': 536}, 'environment': 'debian/match:codename=trixie:variant=sbuild', 'build_components': ['any', 'all'], 'host_architecture': 'amd64'} Error: "'debian' does not exist or is hidden"

I think that the user should see something (e.g. an artifact generated by the work request with the error).