Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Examples of errors detected by the V305…

Examples of errors detected by the V3052 diagnostic

V3052. The original exception object was swallowed. Stack of original exception could be lost.


Xamarin.Forms

V3052 The original exception object 'ex' was swallowed. Stack of original exception could be lost. Xamarin.Forms.Core.UnitTests ImageTests.cs 221


static async Task<Stream>
GetStreamAsync (Uri uri, CancellationToken cancellationToken)
{
  try {
    await Task.Delay (5000, cancellationToken);
  } catch (TaskCanceledException ex) {
    cancelled = true;
    throw ex;
  }
  ....
}

Xamarin.Forms

V3052 The original exception object 'ae' was swallowed. Stack of original exception could be lost. Xamarin.Forms.Xaml RegisterXNamesVisitor.cs 38


public void Visit(ValueNode node, INode parentNode)
{
  ....
  try
  {
    ....
  }
  catch (ArgumentException ae)
  {
    if (ae.ParamName != "name")
      throw ae;
    throw new XamlParseException(
      string.Format("An element with the name \"{0}\"
                     already exists in this NameScope",
                    (string)node.Value), node);
  }
}

FlashDevelop

V3052 The original exception object 'uex' was swallowed. Stack of original exception could be lost. FileActions.cs 598


public void Copy(string fromPath, string toPath)
{
  ....
  try
  {
    ....
  }
  catch (UserCancelException uex)
  {
    throw uex;
  }
  ....
}

SharpDevelop

V3052 The original exception object 'ex' was swallowed. Stack of original exception could be lost. ReferenceFolderNodeCommands.cs 130


DiscoveryClientProtocol DiscoverWebServices(....)
{
  try {
    ....
  } catch (WebException ex) {
    if (....) {
      ....
    } else {
      throw ex;
    }
  }
  ....
}

PascalABC.NET

V3052 The original exception object 'e' was swallowed. Stack of original exception could be lost. NETGenerator NETGenerator.cs 925


public void ConvertFromTree(....)
{
  ....
  try
  {
    ....
  }
  catch (System.Runtime.InteropServices.COMException e)
  {
    throw new TreeConverter.SaveAssemblyError(e.Message);
  }
  ....
}

Similar errors can be found in some other places:

  • V3052 The original exception object 'e' was swallowed. Stack of original exception could be lost. NETGenerator NETGenerator.cs 929
  • V3052 The original exception object 'ex' was swallowed. Stack of original exception could be lost. ICSharpCode.SharpDevelop ReferenceFolderNodeCommands.cs 92
  • V3052 The original exception object 'ex' was swallowed. Stack of original exception could be lost. TreeConverter syntax_tree_visitor.cs 16324

ONLYOFFICE Community Server

V3052 The original exception object 'ex' was swallowed. Stack of original exception could be lost. GoogleDriveStorage.cs 267


public DriveFile CopyEntry(string toFolderId, string originEntryId)
{
    var body = FileConstructor(folderId: toFolderId);
    try
    {
        var request = _driveService.Files.Copy(body, originEntryId);
        request.Fields = GoogleLoginProvider.FilesFields;
        return request.Execute();
    }
    catch (GoogleApiException ex)
    {
        if (ex.HttpStatusCode == HttpStatusCode.Forbidden)
        {
            throw new SecurityException(ex.Error.Message);
        }
        throw;
    }
}

Similar errors can be found in some other places:

  • V3052 The original exception object 'e' was swallowed. Stack of original exception could be lost. FileConverter.cs 564