Commit 2d58170 1 parent 3d674b7 commit 2d58170 Copy full SHA for 2d58170
File tree 1 file changed +14
-2
lines changed
src/Stripe.net/Infrastructure/Public
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,23 @@ private string BuildStripeClientUserAgentString()
222
222
{ "bindings_version" , StripeConfiguration . StripeNetVersion } ,
223
223
{ "lang" , ".net" } ,
224
224
{ "publisher" , "stripe" } ,
225
- { "lang_version" , RuntimeInformation . GetRuntimeVersion ( ) } ,
226
- { "os_version" , RuntimeInformation . GetOSVersion ( ) } ,
227
225
{ "stripe_net_target_framework" , StripeNetTargetFramework } ,
228
226
} ;
229
227
228
+ // The following values are in a try/catch block on the off chance that the
229
+ // RuntimeInformation methods fail in an unexpected way. This should ~never happen, but
230
+ // if it does it should not prevent users from sending requests.
231
+ // See https://github.com/stripe/stripe-dotnet/issues/1986 for context.
232
+ try
233
+ {
234
+ values . Add ( "lang_version" , RuntimeInformation . GetRuntimeVersion ( ) ) ;
235
+ values . Add ( "os_version" , RuntimeInformation . GetOSVersion ( ) ) ;
236
+ }
237
+ catch ( Exception )
238
+ {
239
+ // Do nothing.
240
+ }
241
+
230
242
if ( this . appInfo != null )
231
243
{
232
244
values . Add ( "application" , this . appInfo ) ;
You can’t perform that action at this time.
0 commit comments