Agreed, I'm also sticking to v6 as I spent hours upon hours trying to merge with no success. The equivalent of starting from scratch really so there is no realistic upgrade approach. Getting in touch with some third parties to get a quote on how much it will actually cost to finish a migration like this and based on my own costs it will be significant and not worth the effort.
Is there no migration suggestion to move from Metronic v5 to v6? I spent hours merging and all the new layouts are completely broken. Does this mean going from v6 to v7 of Zero reuqires a completely re-write of all views created with the RAD tool and re-evaluation of all changes made to framework views as well?
Unfortunately not, I still get HTML responses for unhandled exceptions. I simply wrap every mething in a try catch so I can provide my own wrapped response to the clients as I showed in the example.
Do you need to delete the DbBinaryObjectManager
? Since it's a transient dependency I can't fuigure out a way to replace it with a storage version.
Not really prepared to share my client's IP to debug an issue. You can create an application service exactly as described and use an invalid bearer token or even a valid bearer token for a tenant that does not exist (throws and exception too in the middleware somewhere). Anything in the action pipeline that throws and exception seems to result in a 500 with a HTML response, this is very easy to test with PostMan.
For now the mobile app detects the HTML response and parses out the exception... pretty nasty.
[DontWrapResult]
public class MobileAppService : MyAppServiceBase, IMobileAppService
{
[AbpAuthorize]
public async Task<MobileApiOutput> GetStuff()
{
// When the auth token has expired then it never gets here, so can't try/catch and wrap in custom MobileApiOutput.
}
[DisableValidation]
[AbpAuthorize]
public async Task<MobileApiOutput> PostStuff(MobileModel model)
{
// This try block is useless if anything happens in the middleware, you get an HTML "Internal Server Error" page instead.
try
{
// Do stuff...
return new MobileApiOutput() { Success = true };
}
catch (UserFriendlyException ex)
{
return new MobileApiOutput() { Message = ex.Message, Success = false };
}
return new MobileApiOutput() { Message = L("AnErrorOccurred"), Success = false };
}
}
I really just want to catch any internal errors (socket exception being caused by invalid tokens, auth failures etc) so that I can wrap with my own object. Is that not possible?
6.5.0 ASP.NET Core MVC with JQuery
I need to be able to disable all the middleware for calls being made to a certain application service class.
The service is an API for a mobile application and constantly responds with a HTML page for 500 status errors. This includes bearer tokens expiring throwing 500's with socket exceptions and and repository validation errors also bubbling to the client as HTML pages with a 500 status. This makes it impossible to determine what a genuine server errors where it could simply be a 400 for bad input or a 401 for expired tokens etc.
Hoe do I stop all issues being a 500, and how to I stop a web API fom responding with an HTML page?
Doesn't seem to be the case.
From my eaxmple, if a required field on InputDto
is not sent, then you get a 500 HTML page response because of the validation exception, [DisableValidation]
does nothing.
Similarly, the getter is always wrapped in { result: [{}], success: true... }
type JSON even though the attribute [DontWrapResult]
is applied and despite the documentation saying it won't wrap it...