Project

General

Profile

Feature #5116

WEnvironment.C:536 exception

Added by Vasily Pupkin over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Target version:
Start date:
07/19/2016
Due date:
% Done:

0%

Estimated time:

Description

WEnvironment.C says:

const std::string WEnvironment::getCookie(const std::string& cookieName) const

{

CookieMap::const_iterator i = cookies_.find(cookieName);

if (i == cookies_.end())

throw std::runtime_error("Missing cookie: " + cookieName);

else

return i->second;

}

https://github.com/kdeforche/wt/blob/master/src/Wt/WEnvironment.C

Is it possible to cut out this exception (maybe change the signature to return bool), as using exceptions is a bad practice?

It also causes solid hangs in debug mode on windows environment just as any other exception.

Best wishes.

#1

Updated by Vasily Pupkin over 6 years ago

I am sorry, is this description clear enough?

Wt uses that getCookie method for internal matters, so this exception happens and gets handled. But it reduces perfomance and annoys while debugging.

#2

Updated by Koen Deforche over 6 years ago

  • Target version set to 4.0.0

I agree, we should remove this in Wt4 as it is a breaking API change.

#3

Updated by Roel Standaert over 5 years ago

getCookieValue does the same thing, but returns a null pointer when the value is missing instead. I'll make Wt use getCookieValue internally (this seems to only affect WebSession.C).

#4

Updated by Roel Standaert over 5 years ago

  • Status changed from New to Implemented @Emweb

In Wt 4, getCookieValue was renamed to getCookie, and the original getCookie implementation (which can throw) was removed.

#5

Updated by Roel Standaert over 5 years ago

  • Status changed from Implemented @Emweb to Resolved
#6

Updated by Roel Standaert over 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF