Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
c2444f45
Commit
c2444f45
authored
Mar 17, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add serialization API to exceptions
parent
2ce669f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
Message.cs
StackExchange.Redis/StackExchange/Redis/Message.cs
+22
-1
No files found.
StackExchange.Redis/StackExchange/Redis/Message.cs
View file @
c2444f45
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.Serialization
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -12,6 +13,7 @@ namespace StackExchange.Redis
...
@@ -12,6 +13,7 @@ namespace StackExchange.Redis
[
Serializable
]
[
Serializable
]
public
sealed
class
RedisCommandException
:
Exception
public
sealed
class
RedisCommandException
:
Exception
{
{
private
RedisCommandException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
internal
RedisCommandException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisCommandException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisCommandException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
internal
RedisCommandException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
}
...
@@ -22,9 +24,21 @@ public sealed class RedisCommandException : Exception
...
@@ -22,9 +24,21 @@ public sealed class RedisCommandException : Exception
/// Indicates a connection fault when communicating with redis
/// Indicates a connection fault when communicating with redis
/// </summary>
/// </summary>
[
Serializable
]
[
Serializable
]
[
System
.
Diagnostics
.
CodeAnalysis
.
SuppressMessage
(
"Microsoft.Usage"
,
"CA2240:ImplementISerializableCorrectly"
)]
public
sealed
class
RedisConnectionException
:
RedisException
public
sealed
class
RedisConnectionException
:
RedisException
{
{
private
RedisConnectionException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
this
.
FailureType
=
(
ConnectionFailureType
)
info
.
GetInt32
(
"failureType"
);
}
/// <summary>
/// Serialization implementation; not intended for general usage
/// </summary>
public
override
void
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
base
.
GetObjectData
(
info
,
context
);
info
.
AddValue
(
"failureType"
,
(
int
)
this
.
FailureType
);
}
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
)
:
base
(
message
)
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
)
:
base
(
message
)
{
{
this
.
FailureType
=
failureType
;
this
.
FailureType
=
failureType
;
...
@@ -46,6 +60,11 @@ internal RedisConnectionException(ConnectionFailureType failureType, string mess
...
@@ -46,6 +60,11 @@ internal RedisConnectionException(ConnectionFailureType failureType, string mess
[
Serializable
]
[
Serializable
]
public
class
RedisException
:
Exception
public
class
RedisException
:
Exception
{
{
/// <summary>
/// Deserialization constructor; not intended for general usage
/// </summary>
protected
RedisException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
internal
RedisException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
internal
RedisException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
}
...
@@ -55,6 +74,8 @@ public class RedisException : Exception
...
@@ -55,6 +74,8 @@ public class RedisException : Exception
[
Serializable
]
[
Serializable
]
public
sealed
class
RedisServerException
:
RedisException
public
sealed
class
RedisServerException
:
RedisException
{
{
private
RedisServerException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
internal
RedisServerException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisServerException
(
string
message
)
:
base
(
message
)
{
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment