Ejemplo n.º 1
0
        public string TranslateException(Exception exception, IHeaderDictionary headers)
        {
            if (exception is TranslatableException)
            {
                TranslatableException translatableException = exception as TranslatableException;
                return(string.Format(
                           _translationRepository.GetTranslation(
                               Utils.GetLanguageIdFromRequestHeaders(headers),
                               translatableException.TranslationCode),
                           translatableException.Parameters));
            }

            return(exception.Message);
        }