firely-net-sdk icon indicating copy to clipboard operation
firely-net-sdk copied to clipboard

Extend ValidationResult class to allow localization/formatting

Open wmrutten opened this issue 8 years ago • 3 comments

ValidationResult currently only exposes an ErrorMessage property. This prevents clients from localizing/formatting the error message. Proposal:

  • Implement ValidationResult.ErrorId - uniquely identifies each error message The API should expose the available error identifiers as public constants

Advanced:

  • Provide access to dynamic error data, e.g. filenames, element names, position etc. so a client can manually format a user-friendly (localized) error message.

Maybe similar implementation to .NET exception classes?

  • Expose a generic Data collection that provides access to dynamic error properties
  • Implement error-specific subclasses with named properties for specific error properties

wmrutten avatar Jun 06 '16 15:06 wmrutten

Yes this really needs to be done, and a thorough going through all the error messages to make them more user friendly, not just developer friendly. (Such as using the display property from the element definition instead of the path/slice name in the messages) and less intimidating words than instance, cardinality, etc

brianpos avatar Mar 23 '18 05:03 brianpos

This issue is about dotnet attribute validation, not the profile validator, so I removed that label

mmsmits avatar Aug 12 '21 08:08 mmsmits

So, the ValidationResult @wmrutten talks about is this one from the .NET framework: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationresult?view=net-5.0

ewoutkramer avatar Aug 12 '21 08:08 ewoutkramer