Skip to content

Commit

Permalink
more exception detailss
Browse files Browse the repository at this point in the history
  • Loading branch information
nic11 committed Jan 14, 2025
1 parent e303367 commit 276af65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions antigo/src/antigo/impl/OnstackContextImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <string>

#include <cpptrace/basic.hpp>
#include <cpptrace/from_current.hpp>

#include "antigo/impl/complex_values.h"
#include "antigo/ResolvedContext.h"
Expand Down Expand Up @@ -80,11 +81,12 @@ struct OnstackDataFrame {
};

ResolvedMessageEntry Resolve() const {
try {
CPPTRACE_TRY {
return std::visit(ToPreparedVisitor{}, value);
} catch (const std::exception& e) {
return {"error", "ctx: error while resolving value, variant index " + std::to_string(value.index())};
} CPPTRACE_CATCH (const std::exception& e) {
return {"error", "ctx: error while resolving value, variant index " + std::to_string(value.index()) + "\nwhat: " + e.what() + '\n' + cpptrace::from_current_exception().to_string()};
}
return {"error", "resolve error: this code should be unreachable?"};
}
};
static_assert(sizeof(OnstackDataFrame) == 16);
Expand Down

0 comments on commit 276af65

Please sign in to comment.