Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw InvalidContentException with error line number/position in ContentIdentity #6953

Conversation

@nkast
Copy link
Contributor

nkast commented Nov 27, 2019

Uses the existing NewInvalidContentException()
method of ReflectiveSerializer.
That method takes care to report the error linenumber/position by passing it in the ContentIdenity of InvalidContentException.

This results in a consisted error message from mgcb tool.

@nkast

This comment has been minimized.

Copy link
Contributor Author

nkast commented Nov 27, 2019

I removed the line number/pos from the msg as I though it would be just a repetition,
but I noticed that the filtered view on pipeline doesn't show the line number , position.

That an issue with pipeline but for now I can change the msg to include those as it did before.

pipeline3

@Jjagg

This comment has been minimized.

Copy link
Contributor

Jjagg commented Nov 27, 2019

Yeah, let's keep the line info in the message for now.

@nkast nkast force-pushed the nkast:mg_ReflectiveSerializerThrowNewInvalidContentException branch from 708dd7b to 81cfefc Nov 27, 2019
@nkast nkast force-pushed the nkast:mg_ReflectiveSerializerThrowNewInvalidContentException branch from 55aa6ce to d1a11f6 Nov 27, 2019
@nkast

This comment has been minimized.

Copy link
Contributor Author

nkast commented Nov 27, 2019

ok, the error now reads as
"C:/Users/nkast/Desktop/testPipeline/File.spritefont(14,31): The Xml element Size is required, but element `` was found at line 14:31. Try changing the element order or adding missing elements."

@Jjagg

This comment has been minimized.

Copy link
Contributor

Jjagg commented Nov 27, 2019

Great, thanks!

@Jjagg Jjagg merged commit da6fd5d into MonoGame:develop Nov 27, 2019
5 of 6 checks passed
5 of 6 checks passed
Package Mac and Linux Finished TeamCity Build MonoGame / Package Mac and Linux : Exit code 1 (Step: Running NAnt Script (NAnt))
Details
Build Mac, iOS, and Linux Finished TeamCity Build MonoGame / Build Mac : Running
Details
Build Windows, Web, Android, and OUYA Finished TeamCity Build MonoGame / Build Windows : Running
Details
Package Windows SDK Finished TeamCity Build MonoGame / Package Windows : Running
Details
Test Mac Finished TeamCity Build MonoGame / Test Mac : Tests passed: 1150, ignored: 46
Details
Test Windows Finished TeamCity Build MonoGame / Test Windows : Tests passed: 1254, ignored: 20
Details
@nkast nkast deleted the nkast:mg_ReflectiveSerializerThrowNewInvalidContentException branch Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.