You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable rethrowing of errors and passing in strings to errors #446
There are sections of code within Arkouda that throw new Errors in error catch blocks such as this:
It could help in debugging if we enable rethrowing errors by passing the root error in to the init method of the Error being rethrown. It should be pretty straightforward, basically need to add an init method that accepts an Error parameter:
Also, would recommend adding init methods that accept strings which should also help in debugging.
@mhmerrill@reuster986 I updated the error message generation logic to deliver the following:
Two types of messages: one that includes the entire context, which is accessible via ErrorWithContext.message(), which is inherited from the core Chapel Error class, and a second that only contains the string that should be sent back to the calling object and Python client, which is accessible via the ErrorWithContext.publish() method. An example is shown below:
This enables easier integration into try...catch blocks by replacing custom error message generation with invocations of the ErrorWithContext.message() and ErrorWithContext.publish() functions:
Capture of Error class name and inclusion within ErrorWithContext.message() output
Extension of the Errors.getErrorWithContext factory function to enable integration of standard Chapel Errors into the ErrorsWithContext message generation paradigm, which ensures Arkouda can generate consistent error messages with the same contextual information. The message is generated in the following helper function:
An example of core Chapel Error message integration is shown below for FileNotFoundError:
Activity
[-]Enable rethrowing of root errors[/-][+]Enable rethrowing of errors and passing in strings to errors[/+]hokiegeek2 commentedon Oct 6, 2020
Leveraged the getLineNumber(), getRoutineName(), and getModuleName() functions @mhmerrill mentioned, which works well:
Probably a good idea to implement a factory to generate the derived classes of ErrorWithContext.
Moved ErrorWithContext to Errors module, moved DatasetNotFoundError a…
Added logic to generate context-rich error messages for core Chapel e…
Added logic to generate context-rich error messages for core Chapel e…
hokiegeek2 commentedon Oct 15, 2020
@mhmerrill @reuster986 I updated the error message generation logic to deliver the following:
This enables easier integration into try...catch blocks by replacing custom error message generation with invocations of the ErrorWithContext.message() and ErrorWithContext.publish() functions:
Capture of Error class name and inclusion within ErrorWithContext.message() output
Extension of the Errors.getErrorWithContext factory function to enable integration of standard Chapel Errors into the ErrorsWithContext message generation paradigm, which ensures Arkouda can generate consistent error messages with the same contextual information. The message is generated in the following helper function:
An example of core Chapel Error message integration is shown below for FileNotFoundError:
hokiegeek2 commentedon Oct 15, 2020
A few more examples (the top one shows an error handling bug that should be addressed):
Integrated remaining Errors thrown and caught in GenSymIO into ErrorW…
Added more error handling to GenSymIO, fixed merge issue Bears-R-Us#446
Added logic to generate error messages for code blocks where an error…
hokiegeek2 commentedon Oct 18, 2020
@mhmerrill @reuster986 Shall I roll this out across the rest of Arkouda?
Integrated other chapel classes into error handling and logging frame…
Wrapped up rollout of new error handling logic Bears-R-Us#446
hokiegeek2 commentedon Oct 20, 2020
Some more examples of revised error handling. In the first, a sort is attempted on a bool array:
Attempted concatenation of float and bool pdarray:
hokiegeek2 commentedon Oct 20, 2020
Attempted insertion of pdarray of unsupportted datatype in SymTable:
Attempted is_sorted invocation on bool array:
Added unit tests to test error handling and returned error messages B…
hokiegeek2 commentedon Oct 20, 2020
NotImplementedError thrown in UniqueMsg:
NotImplementedError thrown in eFuncMsg
hokiegeek2 commentedon Oct 20, 2020
Error in adding unsupported dtype to MultiTypeSymbolTable:
Incremental checkin with more tetests, fixed dtype checking pdarraycr…
hokiegeek2 commentedon Oct 20, 2020
ak.histogram on bool array:
More unit test cases for error handling, minor cleanup Bears-R-Us#446 B…
hokiegeek2 commentedon Oct 20, 2020
Attempted sort on boolean array:
added more error handling test cases Bears-R-Us#446 Bears-R-Us#329
removed try! clauses per PR feedback Bears-R-Us#446
Fixed throws clause that broke unit tests Bears-R-Us#446
hokiegeek2 commentedon Oct 22, 2020
Development and testing complete, PR merged, issue resolved.