Fix serialization of custom exceptions.
This commit is contained in:
@@ -11,9 +11,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace OpenRA.Utility
|
||||
{
|
||||
[Serializable]
|
||||
public class NoSuchCommandException : Exception
|
||||
{
|
||||
public readonly string Command;
|
||||
@@ -22,6 +24,12 @@ namespace OpenRA.Utility
|
||||
{
|
||||
Command = command;
|
||||
}
|
||||
|
||||
public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
base.GetObjectData(info, context);
|
||||
info.AddValue("Command", Command);
|
||||
}
|
||||
}
|
||||
|
||||
class Program
|
||||
|
||||
Reference in New Issue
Block a user