Hi, I'm using non-core ASP.NET Zero Version 5.6.0 (ASP.NET MVC 5 & AngularJs 1.x) and also published to Azure.
I kept on getting "Your request is invalid!" on DTO custom validation even though I've set the custom validation error message on it.
But I can see the custom validation error message on swagger.
No matter on local machine or Azure environment and I've set customErrors mode = "RemoteOnly".

Thanks. /Tommy
12 Answer(s)
-
0
What is the response body requested in the chrome developer tools web panel?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi maliming,
This is what I got:
{ "result":null, "targetUrl":null, "success":false, "error":{ "code":0, "message":"Your request is not valid!", "details":"The following errors were detected during validation.\r\n - Min and Max must be 0 or blank since Input Type is not Text or Number.\r\n", "validationErrors":[ { "message":"Min and Max must be 0 or blank since Input Type is not Text or Number.", "members":null } ] }, "unAuthorizedRequest":false, "__abp":true }What I wanted to show is:
Min and Max must be 0 or blank since Input Type is not Text or Number.
Instead of:
Your request is invalid!
Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
-
0
Hi maliming,
Is there any setting or configuration related to this?
Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Should be showing the error message here, you can set breakpoint debugging to see,
https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/Abp/Framework/scripts/libs/angularjs/abp.ng.js#L34
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi maliming,
Where to set the breakpoint? DTO or the js file?
When I add in
console.log(error);to that function, it shows nothing when the error occurred.Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
In js file. see abp.ng.js:
https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/Abp/Framework/scripts/libs/angularjs/abp.ng.js#L99
https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/Abp/Framework/scripts/libs/angularjs/abp.ng.js#L34
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi maliming,
It's not hitting the breakpoint.
Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Can you use the Demo project to reproduce the problem you are experiencing? Demo project:https://aspnetzero.com/Download
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi maliming,
With latest version or the same version as mine now?
Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi maliming,
The problem is solved.
This is happening is because my colleague did some changes to the 400 status code error and he just remembered that he did changes to it.
Sorry and thank you helping me.
Thanks. /Tommy
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You're welcome, my friend
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
