Skip to content

Commit

Permalink
Add NotFound when submodel not found within AAS (#337)
Browse files Browse the repository at this point in the history
* Fix bugs w.r.t. test-engine

* Fix for GH issue 333

* Fix for GH issue 333

* Add NotFound exception when submodel not found withing AAS
  • Loading branch information
juileetikekar authored Jul 25, 2024
1 parent 04dc5ab commit 606e879
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


using AasxServer;
using AasxServerStandardBib.Exceptions;
using AasxServerStandardBib.Interfaces;
Expand Down Expand Up @@ -118,7 +118,7 @@ public void DeleteFileByPath(string aasIdentifier, string submodelIdentifier, st
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -132,7 +132,7 @@ public void DeleteSubmodelById(string aasIdentifier, string submodelIdentifier)
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -145,7 +145,7 @@ public void DeleteSubmodelElementByPath(string aasIdentifier, string submodelIde
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}

}
Expand Down Expand Up @@ -234,7 +234,7 @@ public List<ISubmodelElement> GetAllSubmodelElements(string aasIdentifier, strin
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand Down Expand Up @@ -406,7 +406,7 @@ public string GetFileByPath(string aasIdentifier, string submodelIdentifier, str
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}

}
Expand All @@ -421,7 +421,7 @@ public ISubmodel GetSubmodelById(string aasIdentifier, string submodelIdentifier
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -435,7 +435,7 @@ public ISubmodelElement GetSubmodelElementByPath(string aasIdentifier, string su
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -449,7 +449,7 @@ public ISubmodelElement CreateSubmodelElement(string aasIdentifier, string submo
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -463,7 +463,7 @@ public ISubmodelElement CreateSubmodelElementByPath(string aasIdentifier, string
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand Down Expand Up @@ -494,7 +494,7 @@ public void ReplaceSubmodelById(string aasIdentifier, string submodelIdentifier,
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}

}
Expand All @@ -509,7 +509,7 @@ public void ReplaceSubmodelElementByPath(string aasIdentifier, string submodelId
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -523,7 +523,7 @@ public void UpdateSubmodelById(string aasIdentifier, string submodelIdentifier,
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -537,7 +537,7 @@ public void UpdateSubmodelElementByPath(string aasIdentifier, string submodelIde
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand All @@ -551,7 +551,7 @@ public void ReplaceFileByPath(string aasIdentifier, string submodelIdentifier, s
}
else
{
throw new($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
throw new NotFoundException($"Submodel with id {submodelIdentifier} NOT found in AAS with id {aasIdentifier}");
}
}

Expand Down

0 comments on commit 606e879

Please sign in to comment.