I'm encountering an issue with Promise.reject
A warning message pops up: Unhandled promise rejection warning - version 1.1 is not released
How should I go about resolving this warning?
Your assistance is greatly appreciated
public async retrieveVersionFromJira(versionName: string): Promise<ReleaseVersion> {
const searchVersionsUri = config.jiraApiUri + 'versions';
const jsonResp = await this.jiraClient.get(searchVersionsUri);
const version: any = jsonResp.find(version => {
if (version.name == versionName) {
if (version.released == true) {
return Promise.reject("version " + versionName + " is not released");
}
}
});
if (!version) {
return Promise.reject("missing version " + versionName + " on jira");
}
return new ReleaseVersion(version.id, version.name, version.released);
}