Project

General

Profile

What happens if handleRequest throws an exception?

Added by Plug Gulp almost 4 years ago

Is handleRequest noexcept?

I am trying to device an error handling strategy for my code and was wondering what will happen if I miss/forget handling certain exceptions in handleRequest. Should I put an all encompassing try-catch block around the code in handleRequest?

Thanks and kind regards,

~Plug


Replies (1)

RE: What happens if handleRequest throws an exception? - Added by Roel Standaert almost 4 years ago

From what I can see, at the moment, for a static resource, your exception will go all the way up the call stack and cause the application to terminate, yes. You'd have to catch them in handleRequest if you don't want that to happen, indeed.

If the resource is part of a WApplication I see that it's handled just like a typical exception in a WApplication: the session terminates, but the process does not exit.

    (1-1/1)