Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernelci.api.helper: unpack and propagate errors in create_job_node #2305

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kernelci/api/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Dict
import json
import requests

from . import API

Expand Down Expand Up @@ -122,7 +123,11 @@ def create_job_node(self, job_config, input_node,
job_node['data']['runtime'] = runtime.config.name
if platform:
job_node['data']['platform'] = platform.name
return self._api.node.add(job_node)
job_node['data']['asdf'] = 'asdf'
try:
return self._api.node.add(job_node)
except requests.exceptions.HTTPError as error:
raise RuntimeError(json.loads(error.response.text)) from error

def submit_regression(self, regression):
"""Post a regression object
Expand Down
Loading