Project

General

Profile

Feature #1793

Use ErrorContext instead of string FnName

Added by John Abbott about 1 month ago. Updated about 1 month ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
Improving
Target version:
Start date:
16 Mar 2024
Due date:
% Done:

60%

Estimated time:
Spent time:

Description

There is now a class ErrorContext and macro CoCoA_ERROR_CONTEXT for recording:
  • function name
  • file name
  • line number

Consider using ErrorContext instead of a string for FnName.

NB C++20 seems to offer an official version of ErrorContext


Related issues

Related to CoCoALib - Bug #1726: Dangling references to temporariesClosed2023-03-08

Related to CoCoALib - Design #1792: CpuTimeOut: arg of type ErrorContext?New2024-03-15

Related to CoCoALib - Design #582: Error codes: use same code for "not poly ring" and "not elem poly ring"New2014-07-07

History

#1 Updated by John Abbott about 1 month ago

  • Related to Bug #1726: Dangling references to temporaries added

#2 Updated by John Abbott about 1 month ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 60

While resolving issue #1726 I needed to call some arg-check functions specifying where in the source the arg-check was called.
By chance I noticed that we have ErrorContext and the macro (since when? Is there any doc?)
I have modified most calls, but left the old code sommented out -- hope to delete in a couple of weeks.

See also documentation about std::source_location for instance at the following link
https://en.cppreference.com/w/cpp/utility/source_location

#3 Updated by John Abbott about 1 month ago

  • Related to Design #1792: CpuTimeOut: arg of type ErrorContext? added

#4 Updated by John Abbott about 1 month ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99880

#5 Updated by Anna Maria Bigatti about 1 month ago

Added also to NewFreeModuleForSyz.

#6 Updated by Anna Maria Bigatti about 1 month ago

  • Related to Design #582: Error codes: use same code for "not poly ring" and "not elem poly ring" added

Also available in: Atom PDF