Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

try/catch on static method, and internal visibility

  • Loading branch information...
commit 4d50f9ef49d8bf04aeeea1d1843c49ab7ff6324f 1 parent 4a8d23b
@timiles timiles authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 GoCardlessSdk/GoCardless.cs
View
15 GoCardlessSdk/GoCardless.cs
@@ -58,12 +58,19 @@ public static PartnerClient Partner
}
- public static string UserAgent
+ internal static string UserAgent = GetUserAgent();
+ private static string GetUserAgent()
{
- get { return "gocardless-dotnet/v" + AssemblyVersion; }
+ try
+ {
+ return "gocardless-dotnet/v" + GetAssemblyFileVersion();
+ }
+ catch
+ {
+ return "gocardless-dotnet";
+ }
}
- public static readonly string AssemblyVersion = GetAssemblyFileVersion();
- public static string GetAssemblyFileVersion()
+ private static string GetAssemblyFileVersion()
{
Assembly assembly = Assembly.GetAssembly(typeof (GoCardless));
var attributes = assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false)
Please sign in to comment.
Something went wrong with that request. Please try again.