.NET: Improve exception messages for binary misconfiguration and missing assemblies
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e304b48b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e304b48b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e304b48b Branch: refs/heads/ignite-3477 Commit: e304b48b92fe75027442b7f7cfb46b421d58ae49 Parents: d10946b Author: Pavel Tupitsyn <ptupit...@apache.org> Authored: Fri Jan 13 16:49:48 2017 +0300 Committer: Pavel Tupitsyn <ptupit...@apache.org> Committed: Fri Jan 13 16:49:48 2017 +0300 ---------------------------------------------------------------------- .../Apache.Ignite.Core/Impl/Binary/BinaryReader.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e304b48b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs index 100091f..d9facc3 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs @@ -697,10 +697,18 @@ namespace Apache.Ignite.Core.Impl.Binary if (desc.Type == null) { if (desc is BinarySurrogateTypeDescriptor) - throw new BinaryObjectException("Unknown type ID: " + hdr.TypeId); - - throw new BinaryObjectException("No matching type found for object [typeId=" + - desc.TypeId + ", typeName=" + desc.TypeName + ']'); + { + throw new BinaryObjectException(string.Format( + "Unknown type ID: {0}. " + + "This usually indicates missing BinaryConfiguration." + + "Make sure that all nodes have the same BinaryConfiguration.", hdr.TypeId)); + } + + throw new BinaryObjectException(string.Format( + "No matching type found for object [typeId={0}, typeName={1}]." + + "This usually indicates that assembly with specified type is not loaded on a node." + + "When using Apache.Ignite.exe, make sure to load assemblies with -assembly parameter.", + desc.TypeId, desc.TypeName)); } // Preserve old frame.