Skip to content

Commit 4e6211b

Browse files
meshwa19Meshwa Savalia
andauthored
handle all exceptions to avoid system crash (#41)
Co-authored-by: Meshwa Savalia <meshwas@amazon.com>
1 parent fec85c5 commit 4e6211b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Amazon.CloudWatch.EMF/Environment/EC2Environment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public override bool Probe()
5757
{
5858
_token = _resourceFetcher.FetchString(tokenUri, "PUT", tokenRequestHeader);
5959
}
60-
catch (EMFClientException ex)
60+
catch (Exception ex)
6161
{
6262
_logger.LogDebug("Failed to get response from: " + tokenUri, ex);
6363
return false;
@@ -81,7 +81,7 @@ public override bool Probe()
8181
_ec2Metadata = _resourceFetcher.FetchJson<EC2Metadata>(metadataUri, "GET", metadataRequestHeader);
8282
return true;
8383
}
84-
catch (EMFClientException ex)
84+
catch (Exception ex)
8585
{
8686
_logger.LogDebug("Failed to get response from: " + metadataUri, ex);
8787
}

0 commit comments

Comments
 (0)