Skip to content

Unnecessary creation of an error object which is never used? #4465

Open
@StefanOssendorf

Description

@StefanOssendorf

During my NRT work I've found the referenced code.

catch (Exception ex)
{
result.ErrorData = _applicationContext.CreateInstance<DataPortalErrorInfo>(_applicationContext, ex);
throw;
}
finally
{
result = ConvertResponse(result);
}

My understanding is that we create the DataPortelErrorInfo and assign it to the ErrorData property. But the result object is never actually returned. The only "value" is the ConverResponse picks up the error but can't do a thing to influence the program flow.
Should we remove the unnecessary object creation?
It affects the following portals:

  • HttpPortal
  • GrpcPortal
  • RabbitMqPortal

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions