Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit dc447df

Browse files
Merge pull request #558 from github-for-unity/fixes/serializable-exceptions
Adding SerializableAttribute to exception classes
2 parents 182a9bf + e6280b6 commit dc447df

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

src/GitHub.Api/Application/ApiClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ class GitHubRepository
332332
public string CloneUrl { get; set; }
333333
}
334334

335+
[Serializable]
335336
class ApiClientException : Exception
336337
{
337338
public ApiClientException()
@@ -344,6 +345,7 @@ public ApiClientException(string message, Exception innerException) : base(messa
344345
{ }
345346
}
346347

348+
[Serializable]
347349
class TokenUsernameMismatchException : ApiClientException
348350
{
349351
public string CachedUsername { get; }
@@ -356,6 +358,7 @@ public TokenUsernameMismatchException(string cachedUsername, string currentUsern
356358
}
357359
}
358360

361+
[Serializable]
359362
class KeychainEmptyException : ApiClientException
360363
{
361364
public KeychainEmptyException()

src/GitHub.Api/Helpers/Guard.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace GitHub.Unity
77
{
8+
[Serializable]
89
internal class InstanceNotInitializedException : InvalidOperationException
910
{
1011
public InstanceNotInitializedException(object the, string property) :

src/GitHub.Api/Helpers/TaskHelpers.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public static Task<T> ToTask<T>(this Exception exception)
1818
}
1919
}
2020

21+
[Serializable]
2122
public class NotReadyException : Exception
2223
{
2324
}

src/GitHub.Api/Tasks/TaskCanceledExceptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
namespace GitHub.Unity
55
{
6+
[Serializable]
67
class DependentTaskFailedException : TaskCanceledException
78
{
89
public DependentTaskFailedException(ITask task, Exception ex) : base(ex.InnerException != null ? ex.InnerException.Message : ex.Message, ex.InnerException ?? ex)
910
{}
1011
}
1112

13+
[Serializable]
1214
class ProcessException : TaskCanceledException
1315
{
1416
public ProcessException(ITask process) : base(process.Errors)

0 commit comments

Comments
 (0)