Skip to content

Return values needed for several methods in new "full" API #45

@john-boyer-phd

Description

@john-boyer-phd

Some of the methods in the full API, at this moment, are correctly testing whether the underlying C library returned a value != OK and are then raising an exception. All good there, but after that, if the exception didn't happen, then the method should (almost always) return OK. These include:

  1. gp_InitGraph()
  2. gp_CopyGraph()
  3. gp_Read()
  4. gp_Write()
  5. gp_EnsureEdgeCapacity()
  6. All the ExtendWith methods

Other of the methods do already do this.

Also, the reason I said "almost always" is that there is one more method that requires a little more work than just returning OK, and that is gp_AddEdge(). This is because it has two possible return values other than NOTOK, one is OK and the other is now called AT_EDGE_CAPACITY_LIMIT. So, you'll need to

  1. capture the return result from the C layer
  2. throw the exception if the result is not equal to OK and also not equal to AT_EDGE_CAPACITY_LIMIT
  3. if the exception wasn't thrown, then return the result (rather than just always returning OK)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions