[ox/std] Make ox::make handle std::exception to report what()
This commit is contained in:
parent
ead3fd39c4
commit
da6eb40966
5
deps/ox/src/ox/std/new.hpp
vendored
5
deps/ox/src/ox/std/new.hpp
vendored
@ -41,8 +41,11 @@ constexpr T *make(Args &&...args) noexcept {
|
||||
#ifdef __cpp_exceptions
|
||||
try {
|
||||
return new T(ox::forward<Args>(args)...);
|
||||
} catch (std::exception const&ex) {
|
||||
oxPanic(OxError(1, ex.what()), ex.what());
|
||||
return nullptr;
|
||||
} catch (...) {
|
||||
oxPanic(OxError(1, "Allocation or constructor failed"), "Allocation or constructor failed");
|
||||
oxPanic(OxError(2, "Allocation or constructor failed"), "Allocation or constructor failed");
|
||||
return nullptr;
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user