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

Provide better error handling during async things (e.g. graph loading) #156

Merged
merged 3 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading