Exemplo n.º 1
0
        public async Task <RoadStatusList> GetRoadStatusData(string roadNames)
        {
            try
            {
                TfLRoadCorridors apiResponse = await _roadData.GetRoadStatusData(roadNames);

                var result = _mapping.MapRoadStatusData(apiResponse);
                return(result);
            }
            catch (TfLApiException ex)
            {
                RoadStatusException frontEndException = new RoadStatusException(ex.ExceptionDetails.Message);
                frontEndException.ExceptionDetails = ex.ExceptionDetails;
                throw frontEndException;
            }
            catch (Exception ex)
            {
                throw new Exception("Something went wrong. Please try again or contact the developer", ex);
            }
        }