ProCoSys / Bifrost

Application Development Framework promoting good development practices such as CQRS and MVVM (see readme)
http://bifrost.dolittle.com
Other
1 stars 1 forks source link

Query Service: Input string was not in a correct format #67

Closed trymh closed 7 years ago

trymh commented 7 years ago

Should the Query Service do validation of incoming parameters and give a proper error message?

Http request: /GET/Bifrost/Query/Execute?_q=Read.Completion.Tag.CheckLists.CheckListsForHistoricTags

Error log: https://procosys.statoil.com/elmah.axd/detail?id=2b8543a5-70c3-4930-86d2-4023800e4ab8

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Bifrost.Extensions.StringExtensions.ParseTo(String input, Type type) in C:\T\f0471d076df39445\Source\Bifrost\Extensions\StringExtensions.cs:line 86 at Bifrost.Extensions.StringExtensions.ParseTo(String input, Type type) in C:\T\f0471d076df39445\Source\Bifrost\Extensions\StringExtensions.cs:line 82 at Bifrost.Web.Read.QueryService.PopulateProperties(QueryDescriptor descriptor, Type queryType, Object instance) in C:\T\f0471d076df39445\Source\Bifrost.Web\Read\QueryService.cs:line 94 at Bifrost.Web.Read.QueryService.Execute(QueryDescriptor descriptor, PagingInfo paging) in C:\T\f0471d076df39445\Source\Bifrost.Web\Read\QueryService.cs:line 54 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Bifrost.Web.Services.RestServiceMethodInvoker.Invoke(String baseUrl, Object instance, Uri uri, IDictionary`2 inputParameters) in C:\T\f0471d076df39445\Source\Bifrost.Web\Services\RestServiceMethodInvoker.cs:line 55 at Bifrost.Web.Services.RestServiceRouteHttpHandler.ProcessRequest(HttpContext context) in C:\T\f0471d076df39445\Source\Bifrost.Web\Services\RestServiceRouteHttpHandler.cs:line 73

trymh commented 7 years ago

Another example: https://procosys.statoil.com/elmah.axd/detail?id=d438ffb9-7ea2-4831-9e4f-c3a5efc1df65

bnordli commented 7 years ago

Fixed by #69