Skip to content
Snippets Groups Projects
Commit 995ab67e authored by stevereis's avatar stevereis
Browse files

Add catch exareme message error

parent 90239071
No related branches found
No related tags found
No related merge requests found
...@@ -130,26 +130,28 @@ export default class ExaremeService implements IEngineService { ...@@ -130,26 +130,28 @@ export default class ExaremeService implements IEngineService {
this.httpService.get<Pathology[]>(path), this.httpService.get<Pathology[]>(path),
); );
return data.data return (
.filter((data) => !ids || ids.length == 0 || ids.includes(data.code)) data?.data
.map((data): Domain => { .filter((data) => !ids || ids.length == 0 || ids.includes(data.code))
const groups = this.flattenGroups(data.metadataHierarchy); .map((data): Domain => {
const groups = this.flattenGroups(data.metadataHierarchy);
return {
id: data.code, return {
label: data.label, id: data.code,
groups: groups, label: data.label,
rootGroup: dataToGroup(data.metadataHierarchy), groups: groups,
datasets: data.datasets ? data.datasets.map(dataToCategory) : [], rootGroup: dataToGroup(data.metadataHierarchy),
variables: data.metadataHierarchy datasets: data.datasets ? data.datasets.map(dataToCategory) : [],
? this.flattenVariables(data.metadataHierarchy, groups) variables: data.metadataHierarchy
: [], ? this.flattenVariables(data.metadataHierarchy, groups)
}; : [],
}); };
} catch { }) ?? []
);
} catch (error) {
throw new HttpException( throw new HttpException(
`Connection to the engine ${this.options.type} failed`, `Error in exareme engine : '${error.response.data['message']}'`,
HttpStatus.NOT_FOUND, error.response.data['statusCode'] ?? HttpStatus.INTERNAL_SERVER_ERROR,
); );
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment