Skip to content

Commit

Permalink
Switch from exceptions to checked error wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
asl committed Jul 30, 2024
1 parent 11de71f commit c15b572
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 142 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ target_link_libraries(BandageIo PRIVATE Qt6::Gui Qt6::Widgets foonathan::lexy)

# FIXME: Untagle this
add_library(BandageLib STATIC ${LIB_SOURCES} ${FORMS} graphsearch/graphsearchers.cpp)
target_link_libraries(BandageLib PRIVATE BandageLayout BandageIo Qt6::Concurrent Qt6::Widgets Qt6::Svg ${bandage_zlib})
target_link_libraries(BandageLib PRIVATE BandageLayout BandageIo llvmSupport Qt6::Concurrent Qt6::Widgets Qt6::Svg ${bandage_zlib})
target_include_directories(BandageLib INTERFACE ".")

add_library(BandageCLI STATIC ${CLI_SOURCES})
Expand Down
13 changes: 5 additions & 8 deletions graph/assemblygraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void AssemblyGraph::cleanUp() {
m_nodeColors.clear();
m_nodeLabels.clear();
m_nodeCSVData.clear();

clearGraphInfo();
}

Expand Down Expand Up @@ -377,7 +377,7 @@ bool AssemblyGraph::loadCSV(const QString &filename, QStringList *columns, QStri

QStringList cols = utils::splitCsv(in.readLine(), sep);
QString nodeName(cols[0]);

std::vector<DeBruijnNode *> nodes;
// See if this is a path name
// Match using unique prefix of path name. This allows us to load segmented SPAdes
Expand Down Expand Up @@ -501,16 +501,13 @@ QString AssemblyGraph::getNodeNameFromString(QString string) const
// Returns true if successful, false if not.
bool AssemblyGraph::loadGraphFromFile(const QString& filename) {
cleanUp();

auto builder = io::AssemblyGraphBuilder::get(filename);
if (!builder)
return false;

try {
builder->build(*this);
} catch (...) {

if (auto E = builder->build(*this))
return false;
}

determineGraphInfo();

Expand Down
Loading

0 comments on commit c15b572

Please sign in to comment.