Skip to content
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

C++ Error documentation additions #620

Merged

Conversation

@reinecke
Copy link
Collaborator

reinecke commented Nov 19, 2019

  • Added documentation for best practices on schema read errors
  • Created a table outlining C++ error types, how they map to python exceptions, and some semantic description

The error chart may or may not be a good idea. I'd also look to others to help fill in the semantic meanings for some of the errors to make sure I don't write something misleading.

This also poses the question about when it's appropriate to add additional errors. If we tackle that, then it'd be good to outline the steps one should take when doing that.

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 19, 2019

Codecov Report

Merging #620 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #620   +/-   ##
=======================================
  Coverage   81.69%   81.69%           
=======================================
  Files          72       72           
  Lines        2732     2732           
=======================================
  Hits         2232     2232           
  Misses        500      500
Flag Coverage Δ
#py27 81.67% <ø> (ø) ⬆️
#py36 81.67% <ø> (ø) ⬆️
#py37 81.67% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d32687...8480605. Read the comment docs.

docs/cxx/cxx.rst Outdated Show resolved Hide resolved
docs/cxx/cxx.rst Outdated Show resolved Hide resolved
docs/cxx/cxx.rst Outdated Show resolved Hide resolved
@reinecke reinecke marked this pull request as ready for review Dec 7, 2019
@reinecke

This comment has been minimized.

Copy link
Collaborator Author

reinecke commented Dec 7, 2019

Removing draft status on this one. There could be more done here, but it should still add value

Copy link
Collaborator

davidbaraff left a comment

Looks good, but I think we could make the error handling here even shorter and more succinct. how about something like:

bool Marker::read_from(Reader& reader) {
    if (!reader.read(“color”, &_color)) {
        return false;
    }
    if (_color == “invalid_value”) {
        reader.error( ErrorStatus(ErrorStatus::JSON_PARSE_ERROR,
                                                  “invalid_value not allowed for color”));
        return false;
    }
    return reader.read(“marked_range”, &_marked_range) &&
           Parent::read_from(reader);
}
@reinecke

This comment has been minimized.

Copy link
Collaborator Author

reinecke commented Dec 12, 2019

Good call @davidbaraff, I like your version much better.

@ssteinbach ssteinbach added this to the Public Beta 12 milestone Dec 13, 2019
@ssteinbach ssteinbach merged commit a60120b into PixarAnimationStudios:master Dec 13, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
andrewmoore-nz added a commit to andrewmoore-nz/OpenTimelineIO that referenced this pull request Jan 8, 2020
* master:
  Aaf adapter target url fix (PixarAnimationStudios#628)
  C++ Error documentation additions (PixarAnimationStudios#620)
  Issue 622 (PixarAnimationStudios#624)
  Add Kdenlive adapter (PixarAnimationStudios#618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.