<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WienerLinien.Api;

namespace MundlTransit.WP8.Services
{
    public class DefaultMonitorErrorToErrorMessageService
    {

        //RblNotSpecified,
        //DownloadingFailed,
        //ResponseParsingFailed,
        //MonitorsEmpty,

        //ServerDatabaseUnavailable = 311, // DB nicht verfügbar 
        //ServerStopDoesNotExist = 312, // Haltepunkt existiert nicht 
        //ServerCallQuotaExceeded = 316, // max. Anfragen überschritten 
        //ServerAuthenticationFailed = 317, // Sender existiert nicht 
        //ServerQueryStringParameterInvalid = 320, // GET Anfrage Parameter invalid
        //ServerNoDataInDatabase = 322, // keine Daten in der DB vorhanden

        private const string GenericError = "Realtime data could not be downloaded, please try again later.";
        private const string ResponseParsingFailed = "Parsing the response failed.";

        private const string MonitorsEmpty = "No departures available at this time.";
        private const string ServerStopDoesNotExist = "This stop does not exist (stop database out of date?).";
        private const string ServerCallQuotaExceeded = "This app has exceeded the call quota allowed by Wiener Linien.";
        private const string ServerAuthenticationFailed = "This app has failed to authenticate to the Wiener Linien API.";

        public string GetMessage(MonitorInformationErrorCode errCode)
        {
            switch (errCode)
            {
                case MonitorInformationErrorCode.ResponseParsingFailed:
                    return ResponseParsingFailed;
                    break;
                case MonitorInformationErrorCode.MonitorsEmpty:
                    return MonitorsEmpty;
                    break;
                case MonitorInformationErrorCode.ServerStopDoesNotExist:
                    return ServerStopDoesNotExist;
                    break;
                case MonitorInformationErrorCode.ServerCallQuotaExceeded:
                    return ServerCallQuotaExceeded;
                    break;
                case MonitorInformationErrorCode.ServerAuthenticationFailed:
                    return ServerAuthenticationFailed;
                    break;
                default:
                    return GenericError;
                    break;
            }
        }
    }
}<commit_msg>Add error message for every single error case<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WienerLinien.Api;

namespace MundlTransit.WP8.Services
{
    public class DefaultMonitorErrorToErrorMessageService
    {
        //RblNotSpecified,
        //DownloadingFailed,
        //ResponseParsingFailed,
        //MonitorsEmpty,

        //ServerDatabaseUnavailable = 311, // DB nicht verfügbar 
        //ServerStopDoesNotExist = 312, // Haltepunkt existiert nicht 
        //ServerCallQuotaExceeded = 316, // max. Anfragen überschritten 
        //ServerAuthenticationFailed = 317, // Sender existiert nicht 
        //ServerQueryStringParameterInvalid = 320, // GET Anfrage Parameter invalid
        //ServerNoDataInDatabase = 322, // keine Daten in der DB vorhanden

        private const string GenericError = "An unexpected error occured, please try again later.";

        private const string RblNotSpecified = "Internal app error: RBL not specified.";
        private const string DownloadingFailed = "Downloading departure information failed.";
        private const string ResponseParsingFailed = "Parsing the response failed.";
        private const string MonitorsEmpty = "No departures available at this time.";

        private const string ServerDatabaseUnavailable = "Server error reported: Database unavailable.";
        private const string ServerStopDoesNotExist = "This stop does not exist (stop database out of date?).";
        private const string ServerCallQuotaExceeded = "This app has exceeded the call quota allowed by Wiener Linien.";
        private const string ServerAuthenticationFailed = "This app has failed to authenticate to the Wiener Linien API.";
        private const string ServerQueryStringParameterInvalid = "This app has failed to send a properly formatted query to the Wiener Linien API.";
        private const string ServerNoDataInDatabase = "Server error reported: No data in database.";

        public string GetMessage(MonitorInformationErrorCode errCode)
        {
            switch (errCode)
            {
                case MonitorInformationErrorCode.RblNotSpecified:
                    return RblNotSpecified;
                    break;
                case MonitorInformationErrorCode.DownloadingFailed:
                    return DownloadingFailed;
                    break;
                case MonitorInformationErrorCode.ResponseParsingFailed:
                    return ResponseParsingFailed;
                    break;
                case MonitorInformationErrorCode.MonitorsEmpty:
                    return MonitorsEmpty;
                    break;
                case MonitorInformationErrorCode.ServerDatabaseUnavailable:
                    return ServerDatabaseUnavailable;
                    break;
                case MonitorInformationErrorCode.ServerStopDoesNotExist:
                    return ServerStopDoesNotExist;
                    break;
                case MonitorInformationErrorCode.ServerCallQuotaExceeded:
                    return ServerCallQuotaExceeded;
                    break;
                case MonitorInformationErrorCode.ServerAuthenticationFailed:
                    return ServerAuthenticationFailed;
                    break;
                case MonitorInformationErrorCode.ServerQueryStringParameterInvalid:
                    return ServerQueryStringParameterInvalid;
                    break;
                case MonitorInformationErrorCode.ServerNoDataInDatabase:
                    return ServerNoDataInDatabase;
                    break;
                default:
                    return GenericError;
                    break;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.051627384960718295, 'fraction_numerical': 0.006092672759339426, 'mean_word_length': 2.1143285072391413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '832197', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1321, 'n_words': 419}