Questions tagged [onexception]
27 questions
16
votes
2 answers
ErrorAttribute vs OnException vs Application_Error
I want to handle application wide error and show a ErrorView page in asp.net mvc.
There are 3 ways to do it (or i know).
1) ErrorAttribute in BaseController:Controller class.
Can be used on individual Action/Controller/BaseController.
2)…

Mangesh
- 3,987
- 2
- 31
- 52
10
votes
6 answers
ASP.NET MVC Controller.OnException not being called
I have a base controller class where I'm overriding to the Controller.OnException handler method in order to provide a generic error handling for certain types of controllers that will inherit from this class (these are API controllers that will…

Stephen franklin
- 303
- 1
- 3
- 11
10
votes
1 answer
Determine result type in OnException of controller
I'm working on an MVC.NET 2.0 project where I'm trying to put in some special error handling logic in the OnException method of the controller. Basically I want to be able to determine the result type of the controller method in which the unhandled…

Chris Dellinger
- 2,292
- 4
- 25
- 33
8
votes
2 answers
Apache Camel onException
I want to catch all Exception from routes.
I add this OnExeption :
onException(Exception.class).process(new MyFunctionFailureHandler()).stop();
Then, I create the class MyFunctionFailureHandler.
public class MyFunctionFailureHandler implements…

Kikou
- 1,895
- 4
- 20
- 32
7
votes
1 answer
Any way to recover model passed to POST action when inside OnException(ExceptionContext filterContext)?
Situation is this:
I can't find a way of getting the viewModel that was passed to the POST action method.
[HttpPost]
public ActionResult Edit(SomeCoolModel viewModel)
{
// Some Exception happens here during the action execution...
}
Inside the…

Leniel Maccaferri
- 100,159
- 46
- 371
- 480
4
votes
3 answers
How can you set the logger (log category / log name) in Camel's onException clause?
I have the following route:
onException(Exception.class)
.logExhausted(true)
.logStackTrace(true)
.logExhaustedMessageHistory(true)
.process(new MyErrorProcessor());
…

Nazaret K.
- 3,409
- 6
- 22
- 31
4
votes
1 answer
Camel's CXF component not catching onException(Exception.class)
I have a camel-cxf webservice up. I use to handle all SOAP Faults in the CXF's SOAP Fault Interceptor mechanism. That is working well.
I thought that its better to handle Exception thrown at the Camel layer at the same layer and wrote a simple…

Anoop Hallimala
- 625
- 1
- 11
- 25
2
votes
2 answers
onException and onCompletion together in RouteBuilder`s route
I would like to use OnException & OnComplition together in one route (Camel version 2.10.0.redhat-60024):
from("direct:camelTestEndpoint").
onCompletion().
log("onCompletion1").
log("onCompletion2").
…

Yamahar1sp
- 510
- 1
- 6
- 13
1
vote
2 answers
How to handle an exception in an exception block in apache camel
I am trying to handle an exception within apache camel in onException. Can someone guide me if it is possible?
I have written another onException which will handle all Exceptions, but the flow is not transferred to that exception…

minie
- 21
- 3
1
vote
1 answer
PostSharp OnException. How can i get arguments for complex parameters
I wrote a OnMethodBoundaryAspect attribute for Logging the methods exceptions.
I am in trouble with Complex method parameter.
The method signature is:
TestClass m_tf = new TestClass();
m_tf.DoWorkInternal(1, new Prova1() { ProvaP1=10, ProvaP2=11…

user783244
- 111
- 1
- 9
1
vote
1 answer
MVC HttpRequestValidationException exception
I am coding a MVC 5 internet application and have a question in regards to the HttpRequestValidationException exception.
My previous code in my controller is as follows:
protected override void OnException(ExceptionContext filterContext)
{
//…

Simon
- 7,991
- 21
- 83
- 163
1
vote
1 answer
MVC 5 - Pass object to a shared view
I am developing a MVC 5 internet application and have a question in regards to passing an object to a shared view.
I have a view called CustomError.cshtml in the shared folder. This view has the following model type: @model…

Simon
- 7,991
- 21
- 83
- 163
1
vote
1 answer
Different Aspects to handle different Exceptions
From the reading that I have done, I expected that I would be able to create different Aspects inherited from OnExceptionAspect that would allow me to handle different Exceptions differently in my code.
To this end I have created two Aspect classes…

Jay
- 13
- 3
1
vote
1 answer
Camel onException doesn't catch NoMessageIdException of idempotentConsumer?
Example route:
onException(Exception.class)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("it works");
}
})
…

Nazaret K.
- 3,409
- 6
- 22
- 31
1
vote
1 answer