Skip to content

Mesh_io should throw an exception on invalid input file #1640

@OwenMcGee

Description

@OwenMcGee

Currently in read_mesh in vital/io/mesh_io.cxx, if the filename parameter does not end with a valid file extension (.ply2, .ply, or .obj), the function still returns the uninitialized mesh_sptr, when it should throw an exception indicating the bad input.

Outside of the function itself, the only reference to this code that would need to be updated as far as I can tell is in vital/tests/test_mesh_io.cxx.

All other read_ functions in the file are also lacking any exceptions, and don't verify that the input files are properly structured. In the case that a file is incorrectly formatted, they will also still return a mesh_sptr, which may be uninitialized or otherwise improperly formed. There should be verification that the input files are formatted correctly, and exceptions should be thrown if they are not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clean-upThis is not a bug, but could use simplifying or tidying up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions