Skip to content

When 2 validation errors happen, exception should contain both errors #24

@simonech

Description

@simonech

I added two empty units (without segments) I get exception only for the first error it encounters, not for all the errors.
For example

            XliffDocument xliff = new XliffDocument("en-GB");
            Localization.Xliff.OM.Core.File file = new Localization.Xliff.OM.Core.File("f1");
            xliff.Files.Add(file);

            Unit unit1 = new Unit("u1");
            Unit unit2 = new Unit("u2");

            file.Containers.Add(unit1);
            file.Containers.Add(unit2);

And I write it using the sample code

try
{
	using (IO.Stream stream = new IO.MemoryStream())
	{
		XliffWriter writer;

		writer = new XliffWriter();
		writer.Serialize(stream, document);
	}
}
catch (ValidationException e)
{
	Console.WriteLine("ValidationException Details:");
	Console.WriteLine(e.Message);
	if (e.Data != null)
	{
		foreach (object key in e.Data.Keys)
		{
			Console.WriteLine("  '{0}': '{1}'", key, e.Data[key]);
		}
	}
}

I get

ValidationException Details:
The element must contain one or more Resources.
  'SelectorPath': '#/f=f1/u=u1'

while I should also get '#/f=f1/u=u2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions