ChimeraTK / ChimeraTK/DeviceAccess

Put exceptionHandling for isReadable() / isWriteable() into the TransferElement base class

Open
#166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12
Forks
12
Avg merge
2d 14h
Merged PRs (30d)
13

Description

For postRead() and postWrite() the call to _exceptionBackend::setException() is happening in the TransferElement base class.
isReadable() and isWriteable() also have to call setException() when they raise a ChimeraTK::runtime_error. Currently all implementations have to do this themselves.

Taks:

  • Move all existing isReadable() and isWriteable() implementations to isReadable_impl() and isWriteable_impl() in all backends
  • Introduce non-virtual functions isReadable() and isWriteable() which
    • catch runtime_errors throw by the _impl()
    • call _exceptionBackend::setException()
    • re-throw the exception
  • Make isReadOnly() a fixed, non-virtual implementation which returns isReadable() && !isWriteable(), and remove all implementations in the backends

As this is an interface change which requires to touch all backends, it should be done together with #165, which also requires that.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the TransferElement base class and locating every backend implementation of isReadable(), isWriteable(), and isReadOnly(); also review the related interface change in issue #165. Done means the implementations use the _impl() methods, the base class handles runtime_error exceptions and setException(), and backend-specific isReadOnly() implementations are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.