Skip to content

Commit 7804d5f

Browse files
author
sam.gerene
committed
[Code Cleanup] minor code cleanup
1 parent 1f6c862 commit 7804d5f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

SySML2.NET.REST/RestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public async Task<IEnumerable<Project>> Open(string username, string password, s
105105
var projects = await this.RequestProjects(null, null, cancellationToken);
106106
return projects;
107107
}
108-
catch (Exception e)
108+
catch (Exception)
109109
{
110110
this.baseUri = null;
111111
throw;

SySML2.NET.REST/Session.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class Session : ISession
4040
/// <summary>
4141
/// Dependency injected <see cref="IRestClient"/> used to perform HTTP requests
4242
/// </summary>
43-
private IRestClient restClient;
43+
private readonly IRestClient restClient;
4444

4545
/// <summary>
4646
/// Initializes a new instance of the <see cref="Session"/> class
@@ -66,9 +66,17 @@ public Session(IRestClient restClient)
6666
/// </param>
6767
public async Task Open(string username, string password, string uri, CancellationToken cancellationToken)
6868
{
69-
await this.restClient.Open(username, password, uri, cancellationToken);
70-
71-
this.baseUri = uri;
69+
try
70+
{
71+
this.baseUri = uri;
72+
73+
await this.restClient.Open(username, password, this.baseUri, cancellationToken);
74+
}
75+
catch (Exception)
76+
{
77+
this.baseUri = null;
78+
throw;
79+
}
7280
}
7381

7482
/// <summary>

0 commit comments

Comments
 (0)