-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review use of exceptions #18
Comments
Exceptions and Error Handling section is currently under Algorithms
Are all
We need to be sure to review spec to make sure all possible
All calls to Allocator::allocate may throw. Do we need to specify which exception(s)?
|
Scott began a section on exceptions, which I have updated.
Scott also added some notes on errors in the GraphBLAS C API, which I have moved to below:
Notes on C API errors
Informational return values
SUCCESS
: not necessary with exceptionsNO_VALUE
: happens in extractElement() method when providing a transparent destination scalar and no stored value. Usinggrb::out_of_range
exception. The justification for changing informational return with exception is the consistency with STL containerat()
method behaviour.API errors
UNINITIALIZED_OBJECT
: not necessary with RAII philosophyNULL_POINTER
: not necessary, no pointers used in C++ APIINVALID_VALUE
:INVALID_INDEX
: This is specifically for indices that are outside the defined dimensions (forsetElement()
,extractElement()
,removeElement()
). Does this overload withNO_VALUE
?DOMAIN_MISMATCH
: not applicable in C++...if it compiles there is no mismatch.OUTPUT_NOT_EMPTY
: was used when trying tobuild
with a container that is not empty....what should C++ do?NOT_IMPLEMENTED
: ???Execution Errors
PANIC
- do we need this?OUT_OF_MEMORY
: usingstd::bad_alloc
... why notgrb::bad_alloc
? Because allocators not part of GraphBLAS spec.INSUFFICIENT_SPACE
: ???INVALID_OBJECT
: The requires a discussion of exception quarantees. I.e. what is the state of an output object when an exception is thrown during an operation it was called with? This is also complicated by non-blocking mode which is deferred for now.INDEX_OUT_OF_BOUNDS
:grb::out_of_range
(This is overloaded use...for two different meanings)EMPTY_OBJECT
: (only called in reduce to scalar...does C++ API side step this)The text was updated successfully, but these errors were encountered: