Project

General

Profile

Actions

Feature #5116

closed

WEnvironment.C:536 exception

Added by Vasily Pupkin over 7 years ago. Updated almost 7 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.

Actions #1

Updated by Vasily Pupkin over 7 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.

Actions #2

Updated by Koen Deforche over 7 years ago

  • Target version set to 4.0.0

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

Actions #3

Updated by Roel Standaert about 7 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).

Actions #4

Updated by Roel Standaert about 7 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.

Actions #5

Updated by Roel Standaert about 7 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #6

Updated by Roel Standaert almost 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF