Skip to content

Commit 126510e

Browse files
committed
Updated error messaging when Route of a Page contains incorrect route parameters.
1 parent 76dd1d6 commit 126510e

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

Modules/Intent.Modules.Blazor/Api/RouteManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ private List<string> GetExpressions(string str)
4747
{
4848
var fromPos = str.IndexOf("{", StringComparison.Ordinal) + 1;
4949
var toPos = str.IndexOf("}", StringComparison.Ordinal);
50+
51+
if (fromPos >= toPos)
52+
{
53+
throw new FormatException($"Route '{str}' is not formatted corrected. Brace pairing {{ }} is invalid.");
54+
}
55+
5056
var expression = str[fromPos..toPos];
5157
result.Add(expression);
5258
str = str[(str.IndexOf("}", StringComparison.Ordinal) + 1)..];

Modules/Intent.Modules.Blazor/Intent.Blazor.imodspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package>
33
<id>Intent.Blazor</id>
4-
<version>1.0.5-pre.2</version>
4+
<version>1.0.5-pre.3</version>
55
<supportedClientVersions>[4.5.0-a, 5.0.0-a)</supportedClientVersions>
66
<summary>Automates the bootstrapping and core patterns of a Blazor web application.</summary>
77
<description>Automates the bootstrapping and core patterns of a Blazor web application.</description>

Modules/Intent.Modules.Blazor/Intent.Modules.Blazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<Version>1.0.5-pre.1</Version>
5+
<Version>1.0.5-pre.3</Version>
66
<Authors>Intent Architect</Authors>
77
<Description>Base classes and helpers for building templates for Blazor for Intent Architect.</Description>
88
<Copyright>Copyright 2024</Copyright>

Modules/Intent.Modules.Blazor/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Version 1.0.5
22

33
- Improvement: Updated NuGet package versions.
4+
- Improvement: Updated error messaging when Route of a `Page` contains incorrect route parameters.
45
- Fixed: SF Crash in scenario of remote service with missing mappings.
56
- Fixed: When newer versions of the `Intent.Code.Weaving.Razor` module was installed, ``<>f__AnonymousDelegate0`2[System.String,System.String]`` would appear on the home page.
67

0 commit comments

Comments
 (0)