Skip to content

Commit 01d2885

Browse files
committed
234
1 parent 351eec6 commit 01d2885

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/realm/object-store/c_api/error.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ void ErrorStorage::assign(std::exception_ptr eptr) noexcept
113113

114114
// Core exceptions:
115115
catch (const Exception& ex) {
116+
printf("ErrorStorage error message: %s\n", ex.what());
116117
populate_error(ex, ex.code());
117118
if (ex.code() == ErrorCodes::CallbackFailed) {
119+
printf("ex.code is ErrorCodes::CallbackFailed\n");
118120
m_err->usercode_error = static_cast<const CallbackFailed&>(ex).usercode_error;
119121
}
120122
if (ErrorCodes::error_categories(ex.code()).test(ErrorCategory::file_access)) {
@@ -126,25 +128,32 @@ void ErrorStorage::assign(std::exception_ptr eptr) noexcept
126128

127129
// Generic exceptions:
128130
catch (const std::invalid_argument& ex) {
131+
printf("ErrorStorage invalid argument error message: %s\n", ex.what());
129132
populate_error(ex, ErrorCodes::InvalidArgument);
130133
}
131134
catch (const std::out_of_range& ex) {
135+
printf("ErrorStorage out_of_range error message: %s\n", ex.what());
132136
populate_error(ex, ErrorCodes::OutOfBounds);
133137
}
134138
catch (const std::logic_error& ex) {
139+
printf("ErrorStorage std::logic_error message: %s\n", ex.what());
135140
populate_error(ex, ErrorCodes::LogicError);
136141
}
137142
catch (const std::runtime_error& ex) {
143+
printf("ErrorStorage std::runtime_error message: %s\n", ex.what());
138144
populate_error(ex, ErrorCodes::RuntimeError);
139145
}
140146
catch (const std::bad_alloc& ex) {
147+
printf("ErrorStorage std::exception message: %s\n", ex.what());
141148
populate_error(ex, ErrorCodes::OutOfMemory);
142149
}
143150
catch (const std::exception& ex) {
151+
printf("ErrorStorage std::exceptio message: %s\n", ex.what());
144152
populate_error(ex, ErrorCodes::UnknownError);
145153
}
146154
// FIXME: Handle more exception types.
147155
catch (...) {
156+
printf("ErrorStorage RLM_ERR_UNKNOWN message\n");
148157
m_err->error = RLM_ERR_UNKNOWN;
149158
m_message_buf = "Unknown error";
150159
m_err->message = m_message_buf.c_str();

0 commit comments

Comments
 (0)