Skip to content

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

Description

@p-dim-popov

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

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions