@@ -77,7 +77,7 @@ namespace zero::async::promise {
7777 assert (mCore );
7878
7979 if (mRetrieved )
80- throw std::logic_error{" Future already retrieved" };
80+ throw error::StacktraceError< std::logic_error> {" Future already retrieved" };
8181
8282 mRetrieved = true ;
8383 return Future<T, E>{mCore };
@@ -107,7 +107,9 @@ namespace zero::async::promise {
107107 }
108108
109109 if (state != State::OnlyCallback || !mCore ->state .compare_exchange_strong (state, State::Done))
110- throw std::logic_error{fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))};
110+ throw error::StacktraceError<std::logic_error>{
111+ fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))
112+ };
111113
112114 mCore ->event .set ();
113115 mCore ->trigger ();
@@ -130,7 +132,9 @@ namespace zero::async::promise {
130132 }
131133
132134 if (state != State::OnlyCallback || !mCore ->state .compare_exchange_strong (state, State::Done))
133- throw std::logic_error{fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))};
135+ throw error::StacktraceError<std::logic_error>{
136+ fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))
137+ };
134138
135139 mCore ->event .set ();
136140 mCore ->trigger ();
@@ -258,7 +262,9 @@ namespace zero::async::promise {
258262 return ;
259263
260264 if (state != State::OnlyResult || !mCore ->state .compare_exchange_strong (state, State::Done))
261- throw std::logic_error{fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))};
265+ throw error::StacktraceError<std::logic_error>{
266+ fmt::format (" Unexpected promise state: {}" , std::to_underlying (state))
267+ };
262268
263269 mCore ->trigger ();
264270 }
0 commit comments