Skip to content

Commit f5bf324

Browse files
authored
ROU-12040: Handling promise error (#212)
1 parent 7b6c9ab commit f5bf324

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/OutSystems/Maps/MapAPI/Directions.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ namespace OutSystems.Maps.MapAPI.Directions {
5353
export async function SetDirections(mapId: string, options: string): Promise<string> {
5454
const map = MapManager.GetMapById(mapId, true);
5555
const directionOptions = JSON.parse(options);
56-
return map.features.directions.setRoute(directionOptions).then((response) => JSON.stringify(response));
56+
return map.features.directions
57+
.setRoute(directionOptions)
58+
.then((result) => {
59+
return JSON.stringify(result);
60+
})
61+
.catch((error) => {
62+
return JSON.stringify(error);
63+
});
5764
}
5865

5966
/**

0 commit comments

Comments
 (0)