Initially the scope of this task was to catch an error caused from an invalid subject identifier, preventing a status 500 error. As that change has already been implemented after the creation of this ticket, the new scope of this task is to add code to catch the specific error that is caused from the invalid identifier. Currently, when an invalid subject identifier is entered the user will receive a response of "unexpected error"; to give more transparency to the user for the error we want to return the specific reason.
New Error Response
{
"error": "Koji XMLRPC fault due to: 'invalid format: nieco'", <--( New Response )
"scenario": null,
"sources": [],
"subject_identifier": "nieco",
"subject_type": "koji_build",
"testcase": "failed-fetch-gating-yaml",
"type": "failed-fetch-gating-yaml"
},
Note: The "invalid format: nieco" is the full 'err.faultString' response from the xmlrpc.client.Fault Exception. The exception, "err", does not provide any fields to parse to extract that it is regarding the subject_identifier.
Jira Ticket: https://projects.engineering.redhat.com/browse/CWFHEALTH-460
Initially the scope of this task was to catch an error caused from an invalid subject identifier, preventing a status 500 error. As that change has already been implemented after the creation of this ticket, the new scope of this task is to add code to catch the specific error that is caused from the invalid identifier. Currently, when an invalid subject identifier is entered the user will receive a response of "unexpected error"; to give more transparency to the user for the error we want to return the specific reason.
Old Error Response
{
"error": "Unexpected error", <--( Old response )
"scenario": null,
"sources": [],
"subject_identifier": "nieco",
"subject_type": "koji_build",
"testcase": "failed-fetch-gating-yaml",
"type": "failed-fetch-gating-yaml"
},
New Error Response
{
"error": "Koji XMLRPC fault due to: 'invalid format: nieco'", <--( New Response )
"scenario": null,
"sources": [],
"subject_identifier": "nieco",
"subject_type": "koji_build",
"testcase": "failed-fetch-gating-yaml",
"type": "failed-fetch-gating-yaml"
},
Note: The "invalid format: nieco" is the full 'err.faultString' response from the xmlrpc.client.Fault Exception. The exception, "err", does not provide any fields to parse to extract that it is regarding the subject_identifier.