Skip to content

Downgrade IsEqual crashing from error to warning #3444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .ci/code/Serialiser_Test/Verify/ObjectsToFromJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/**** Test Methods ****/
/*************************************/

public static TestResult ObjectsToFromJson()

Check warning on line 44 in .ci/code/Serialiser_Test/Verify/ObjectsToFromJson.cs

View check run for this annotation

BHoMBot-CI / documentation-compliance

.ci/code/Serialiser_Test/Verify/ObjectsToFromJson.cs#L44

Method must contain an Output or MultiOutput attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/HasOutputAttribute
{
// Test all the BHoM types available
List<Type> types = Helpers.ObjectTypesToTest();
Expand All @@ -65,7 +65,7 @@

/*************************************/

public static TestResult ObjectToFromJson(Type type)

Check warning on line 68 in .ci/code/Serialiser_Test/Verify/ObjectsToFromJson.cs

View check run for this annotation

BHoMBot-CI / documentation-compliance

.ci/code/Serialiser_Test/Verify/ObjectsToFromJson.cs#L68

Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent Method must contain an Output or MultiOutput attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/HasOutputAttribute
{
string typeDescription = type.IToText(true);

Expand Down Expand Up @@ -140,8 +140,15 @@
}
catch (Exception e)
{
BH.Engine.Base.Compute.RecordError(e, $"Failed to compare the objcets of type {type.Name}");
isEqual = false;
BH.Engine.Base.Compute.RecordWarning(e, $"Crashed when trying to compare objects.");

return new TestResult
{
Description = typeDescription,
Status = TestStatus.Warning,
Message = $"Warning: Failed to compare objects of type {typeDescription}.",
Information = Engine.Base.Query.CurrentEvents().Select(x => x.ToEventMessage()).ToList<ITestInformation>()
};
}

if (!isEqual)
Expand Down