Opened on 07/16/2014 at 01:13:23 PM

Last modified on 12/07/2014 at 10:53:29 PM

#1060 new change

Use system_error mechanism

Reported by: sergz Assignee:
Priority: P4 Milestone:
Module: Adblock-Plus-for-Internet-Explorer Keywords:
Cc: Blocked By:
Blocking: Platform: Internet Explorer
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):



In the project there are several domains of the runtime errors, at least

  • from std classes
  • based on Windows API GetLastError()
  • our own domain, unexpected value of some input arguments, or some state is inconsistent, like pipe became closed, which is basically should be GetLastError()

Fortunately, now there is a standard way to handle different errors uniformly.

What to change

First of all we should fix the usage of GetLastError(). GetLastError() should be called before anything else. At least now we are creating some strings which involves memory allocation, which can modify the result of GetLastError().

We have to have custom error_category (C++11) for GetLastError(). Since we are not going to create the insane enum for all Windows error codes and properly implement the equivalence, so only implement partially (name, message (based on FormatMessage)) error_category and the factory method (which should not be available using ADL, something like std::error_code makeWinErrorCode(int code);).

Attachments (0)

Change History (2)

comment:1 Changed on 07/16/2014 at 01:31:56 PM by sergz

  • Component changed from Unknown to Adblock-Plus-for-Internet-Explorer
  • Priority changed from Unknown to P4

comment:2 Changed on 12/07/2014 at 10:53:29 PM by oleksandr

  • Ready set

Add Comment

Modify Ticket

Change Properties
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
Note: See TracTickets for help on using tickets.