Skip to content
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

Error when parse to required type in function action declaration is not successful #59

Open
p-dim-popov opened this issue Oct 18, 2020 · 0 comments

Comments

@p-dim-popov
Copy link

p-dim-popov commented Oct 18, 2020

Action is:

public HttpResponse Create(int range, ...)
{ ...

Test situation is:
image

Exception is:

System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType)
   at SUS.MvcFramework.Host.ExecuteAction(HttpRequest request, Type controllerType, MethodInfo action, IServiceCollection serviceCollection) in C:\fakepath\SUS.MvcFramework\Host.cs:line 95
   at SUS.MvcFramework.Host.<>c__DisplayClass1_2.<AutoRegisterRoutes>b__3(HttpRequest request) in C:\fakepath\SUS.MvcFramework\Host.cs:line 70
   at SUS.HTTP.HttpServer.ProcessClientAsync(TcpClient tcpClient) in C:\fakepath\SUS.HTTP\HttpServer.cs:line 73

Probably should be set to default instead of throwing exception and resulting to:
image

@p-dim-popov p-dim-popov changed the title Error when parse is not successful to required type in function action declaration Error when parse to required type in function action declaration is not successful Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant