MatchaSync | plugin library for offline data sync | Data Processing library
kandi X-RAY | MatchaSync Summary
kandi X-RAY | MatchaSync Summary
A plugin library for offline data sync, provides an SDK library for both Client & Server
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MatchaSync
MatchaSync Key Features
MatchaSync Examples and Code Snippets
Community Discussions
Trending Discussions on MatchaSync
QUESTION
I am trying to implement .NET Core 3 app.UseExceptionHandler for an API project, but I have a generic logger per API controller that I would like to pass into the error method. If, for instance, the error happens in my WorkingController, I would like to have ILogger
be the logging entity. I have found that using the built-in ExceptionHandler, I lose some of the context of the request, and I would like to capture this context if possible.
Here's what all of my API methods used to look like before:
...ANSWER
Answered 2020-Aug-14 at 19:18Unfortunately, there is simply no built-in way to do this cleanly. You could find a package to help here (I haven't looked), or you could want to re-write some parts of ASP.NET Core, but I wouldn't really want to do that.
There is another way of doing this, which depending on which version you like more, is recommended/recommended against, but I'm pro of the former. Instead of throwing/catching exceptions at the Controller level, I treat Controllers as the dumbest thing possible, so they just call some service and that's it.
If you want to know where an exception was thrown, or you specifically want the exception to go uncaught, a strategy my team follows is to create custom exceptions. You could then leave these uncaught (and the HTTP500 will be returned to the caller) or you could have a custom Middleware and define there what should happen.
The following is an example, written entirely here so there may be some changes needed, and it's solely to demonstrate a possible approach, not a working demo.
Given some exceptions valid to your domain:
QUESTION
I'm using ASP.NET Core 3.1 MVC and areas.
This problem occurs in development using IIS Express, I haven't even got it to the point I can deploy to a live (IIS) server yet. The server is throwing an error 500 at the end of the startup process.
Exception:
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints.
Matches:
FleetLogix.Intranet.Areas.Maps.Controllers.HomeController.Index (FleetLogix.Intranet)
FleetLogix.Intranet.Areas.Admin.Controllers.HomeController.Index (FleetLogix.Intranet)
FleetLogix.Intranet.Controllers.HomeController.Index (FleetLogix.Intranet)at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(CandidateState[] candidateState)
at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates(HttpContext httpContext, CandidateState[] candidateState)
at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select(HttpContext httpContext, CandidateState[] candidateState)
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.MatchAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher.MatchAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
This is my routing:
...ANSWER
Answered 2020-Jun-30 at 03:38The path "/
" or "/Home/Index
" request matched multiple endpoints. You could add area attribute to separate. All tested and worked.
Add
[Area("Admin")]
to/Area/Admin/HomeController
:
QUESTION
I have 2 methods to handle HTTP GET requests, first one for int
type input and the other one for string
type input.
ANSWER
Answered 2019-Sep-29 at 18:08You can use route constraint
QUESTION
I would like the following method to throw a custom exception if an error occurs:
...ANSWER
Answered 2019-Oct-02 at 11:46Instead of using doOnError
I swiched to subscribe method accepting also an error consumer:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MatchaSync
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page