StackTraceExplorer icon indicating copy to clipboard operation
StackTraceExplorer copied to clipboard

The wrapping function not worked properly for non-english environments

Open LeonxPRO opened this issue 3 years ago • 4 comments

Example Stack Trace result for Russian NET environment in VS 2022. Text (full text also attached to post): KKBO.N3Exchange.Remc.Contracts.Exceptions.RemcBaseException: Cannot parse value 'диа' to int for mapping 'CaseResultFromAmbResult' в NetrikaIEMK.Core.JemysDataMapper2.MapFromDbMapping(String mappingName, Object value) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\JemysDataMapper2.cs:строка 45 в NetrikaIEMK.Core.JemysDataMapper2.FromAmbulanceCaseResult[TTo](String value) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\JemysDataMapper2.cs:строка 130 в NetrikaIEMK.Core.AmbulanceTalonToAmbCaseConverter.CaseResultIdFromEmhr(EMHR emhr) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Converters\AmbulanceTalonToAmbCaseConverter.cs:строка 216 в NetrikaIEMK.Core.AmbulanceTalonToAmbCaseConverter.ConvertImplementation(AmbulanceTalon medCase) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Converters\AmbulanceTalonToAmbCaseConverter.cs:строка 64 в NetrikaIEMK.Core.ConverterBase2.Convert(TFrom source) в E:.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Converters\ConverterBase.cs:строка 17 в NetrikaIEMK.Core.MedCaseToNetrikaCaseConverter.ConvertImplementation(CaseOfMedCare medCase) в E:.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Converters\MedCaseToNetrikaCaseConverter.cs:строка 34 в NetrikaIEMK.Core.ConverterBase2.Convert(TFrom source) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Converters\ConverterBase.cs:строка 17 в NetrikaIEMK.Core.CommonMedCaseProcessor.AddCaseInternal(CaseOfMedCare medCase, Session session) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Processors\CommonMedCaseProcessor.cs:строка 385 в NetrikaIEMK.Core.CommonMedCaseProcessor.ProceedCaseInternal(CaseOfMedCare medCase, IEMKApiMethod method, IEMKSession session, Boolean force) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Processors\CommonMedCaseProcessor.cs:строка 300 в NetrikaIEMK.Core.CommonMedCaseProcessor.ProceedCaseInternal(CaseOfMedCare medCase, IEMKApiMethod method, IEMKSession session, Boolean force) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Processors\CommonMedCaseProcessor.cs:строка 320 в NetrikaIEMK.Core.CommonMedCaseProcessor.ProceedCase(CaseOfMedCare medCase, Boolean includePatient, IEMKApiMethod method) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Processors\CommonMedCaseProcessor.cs:строка 214. . Ошибка при смене статуса MIS MedCase 12544103: System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. в System.Data.Entity.Internal.InternalContext.SaveChanges() в System.Data.Entity.Internal.LazyInternalContext.SaveChanges() в System.Data.Entity.DbContext.SaveChanges() в NetrikaIEMK.Dal.AppRepository.SumbitIemkSession(IEMKSession session) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Dal\Repositories\NetrikaIEMKRepository.cs:строка 129 в NetrikaIEMK.Dal.AppRepository.SumbitSession(Session session) в E:\.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Dal\Repositories\NetrikaIEMKRepository.cs:строка 148 в NetrikaIEMK.Dal.Session.Submit(Nullable1 opResult, String message, String code) в E:.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Dal\Models\Session.cs:строка 28 в NetrikaIEMK.Core.CommonMedCaseProcessor.HandleProceedResult(IEMKSession sessionResult, CaseOfMedCare medCase) в E:.gitrepos\KKBO.N3Exchange.Forks\newselector\src\NetrikaIEMK\NetrikaIEMK.Core\Processors\CommonMedCaseProcessor.cs:строка 258`

Result: image StackTrace.txt

LeonxPRO avatar Nov 26 '21 09:11 LeonxPRO

As additional of "at" for in code regex wordwrap function must be also russian "в" (unicode code %u0432).
I think installed NET framework have a predefined constant for word 'at' for current user localization. Just better need get it and replace hard coded 'at'

LeonxPRO avatar Nov 26 '21 09:11 LeonxPRO

Grab the new release! 🚀

I could not find anything about predefined constants, do you have some more info about that?

sboulema avatar Nov 26 '21 15:11 sboulema

Okay, it`s worked! Thank you!

do you have some more info about that No, i just assume that.

LeonxPRO avatar Dec 03 '21 09:12 LeonxPRO

do you have some more info about that? Okay, I found it! You can see useful example at MS sources of StackTrace class and may bge use that Resource methos by reflection: DotNet472ZDP\Source\ndp\clr\src\BCL\system\diagnostics\stacktrace.cs

internal String ToString(TraceFormat traceFormat)
bool displayFilenames = true; 
            String word_At = "at";
            String inFileLineNum = "in {0}:line {1}";

            if(traceFormat != TraceFormat.NoResourceLookup)
            {
                word_At = Environment.GetResourceString("Word_At");
                inFileLineNum = Environment.GetResourceString("StackTrace_InFileLineNumber");
            }
...
...
...

LeonxPRO avatar Dec 03 '21 10:12 LeonxPRO