improved error messages on Jira API 500

This commit is contained in:
Nate 2024-11-01 15:22:51 -07:00
parent 7b5c907533
commit 6d5e2e25d4

View file

@ -156,12 +156,17 @@ export class JiraClient {
},
);
if (response.status !== 200) {
if (response.status === 500) {
const text = await response.text();
console.warn(
"Unable to get jira tickets. Response code from API is",
response.status,
"Unable to get Jira tickets. You may need to set 'apiVersion': 2 in your config.json. See full documentation here: https://docs.continue.dev/customize/context-providers#jira-datacenter-support\n\n",
text,
);
return Promise.resolve([]);
} else if (response.status !== 200) {
const text = await response.text();
console.warn("Unable to get Jira tickets: ", text);
return Promise.resolve([]);
}
const data = (await response.json()) as any;