fix: add better error messages for a couple of error cases#3739
Merged
NoelStephensUnity merged 12 commits intodevelop-2.0.0from Oct 24, 2025
Merged
fix: add better error messages for a couple of error cases#3739NoelStephensUnity merged 12 commits intodevelop-2.0.0from
NoelStephensUnity merged 12 commits intodevelop-2.0.0from
Conversation
- When using a generic INetworkSerializable+IEquatable combo and update documentation with workaround - When there are no initialized elements in the network prefab list (fix null reference exception)
NoelStephensUnity
approved these changes
Oct 23, 2025
Member
NoelStephensUnity
left a comment
There was a problem hiding this comment.
Just made some minor tweaks, but the rest looks good!
👍
Thank you Laurus! 🙌
NoelStephensUnity
approved these changes
Oct 23, 2025
com.unity.netcode.gameobjects/Tests/Editor/NetworkManagerConfigurationTests.cs
Outdated
Show resolved
Hide resolved
EmandM
reviewed
Oct 23, 2025
Member
EmandM
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Just some small notes.
I think there might also be an issue when the list itself has a null prefab. I'm not sure if this fix catches that?
com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Tests/Editor/NetworkManagerConfigurationTests.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Member
Author
This is already handled, this will emit an error message |
larus
added a commit
that referenced
this pull request
Oct 27, 2025
* fix: add better error messages for a couple of error cases - When using a generic INetworkSerializable+IEquatable combo and update documentation with workaround - When there are no initialized elements in the network prefab list (fix null reference exception) * update changelog * style Removing single whitespace at end of sentence. * style Keeping the most recent changelog entry chronologically ordered (ordered by PR number). * Apply suggestions from code review Co-authored-by: Emma <emma.mcmillan@unity3d.com> * add missing pr number * move to inetworkserializable section * switch to testing NetworkConfig directly * remove uninitialized from list instead of ignoring --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Emma <emma.mcmillan@unity3d.com>
6 tasks
larus
added a commit
that referenced
this pull request
Nov 4, 2025
…#3744) * fix: add better error messages for a couple of error cases (#3739) * fix: add better error messages for a couple of error cases - When using a generic INetworkSerializable+IEquatable combo and update documentation with workaround - When there are no initialized elements in the network prefab list (fix null reference exception) * update changelog * style Removing single whitespace at end of sentence. * style Keeping the most recent changelog entry chronologically ordered (ordered by PR number). * Apply suggestions from code review Co-authored-by: Emma <emma.mcmillan@unity3d.com> * add missing pr number * move to inetworkserializable section * switch to testing NetworkConfig directly * remove uninitialized from list instead of ignoring --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Emma <emma.mcmillan@unity3d.com> * update changelog * add test to exceptions list * Apply suggestion from @jabbacakes Co-authored-by: Amy Reeve <amy.reeve@unity3d.com> * Apply suggestion from @jabbacakes Co-authored-by: Amy Reeve <amy.reeve@unity3d.com> --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Emma <emma.mcmillan@unity3d.com> Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
add better error messages for a couple of error cases
Example error printed with the generic IEquatable error is
which is printed in addition to the usual error for not implementing IEquatable.
Jira ticket
MTTB-1202
MTTB-1306
Changelog
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Manually tested the codegen errors with IEquatable.
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Backports
#3744