@@ -18,7 +18,6 @@ ErrorStorage::ErrorStorage(std::exception_ptr ptr) noexcept
1818 , m_usercode_error(nullptr )
1919
2020{
21- printf (" ErrorStorage::ErrorStorage(std::exception_ptr ptr) noexcept\n " );
2221 assign (std::move (ptr));
2322}
2423
@@ -27,15 +26,13 @@ ErrorStorage::ErrorStorage(const ErrorStorage& other)
2726 , m_message_buf(other.m_message_buf)
2827 , m_usercode_error(other.m_usercode_error)
2928{
30- printf (" ErrorStorage::ErrorStorage(const ErrorStorage& other)\n " );
3129 if (m_err) {
3230 m_err->message = m_message_buf.c_str ();
3331 }
3432}
3533
3634ErrorStorage& ErrorStorage::operator =(const ErrorStorage& other)
3735{
38- printf (" ErrorStorage& ErrorStorage::operator=(const ErrorStorage& other)\n " );
3936 m_err = other.m_err ;
4037 m_message_buf = other.m_message_buf ;
4138 m_usercode_error = other.m_usercode_error ;
@@ -50,7 +47,6 @@ ErrorStorage::ErrorStorage(ErrorStorage&& other)
5047 , m_message_buf(std::move(other.m_message_buf))
5148 , m_usercode_error(std::move(other.m_usercode_error))
5249{
53- printf (" ErrorStorage::ErrorStorage(ErrorStorage&& other)\n " );
5450 if (m_err) {
5551 m_err->message = m_message_buf.c_str ();
5652 }
@@ -59,7 +55,6 @@ ErrorStorage::ErrorStorage(ErrorStorage&& other)
5955
6056ErrorStorage& ErrorStorage::operator =(ErrorStorage&& other)
6157{
62- printf (" ErrorStorage& ErrorStorage::operator=(ErrorStorage&& other)\n " );
6358 m_err = std::move (other.m_err );
6459 m_message_buf = std::move (other.m_message_buf );
6560 m_usercode_error = std::move (other.m_usercode_error );
@@ -83,7 +78,6 @@ bool ErrorStorage::operator==(const ErrorStorage& other) const noexcept
8378
8479void ErrorStorage::assign (std::exception_ptr eptr) noexcept
8580{
86- printf (" void ErrorStorage::assign(std::exception_ptr eptr) noexcept\n " );
8781 if (!eptr) {
8882 clear ();
8983 return ;
@@ -113,10 +107,8 @@ void ErrorStorage::assign(std::exception_ptr eptr) noexcept
113107
114108 // Core exceptions:
115109 catch (const Exception& ex) {
116- printf (" ErrorStorage error message: %s\n " , ex.what ());
117110 populate_error (ex, ex.code ());
118111 if (ex.code () == ErrorCodes::CallbackFailed) {
119- printf (" ex.code is ErrorCodes::CallbackFailed\n " );
120112 m_err->usercode_error = static_cast <const CallbackFailed&>(ex).usercode_error ;
121113 }
122114 if (ErrorCodes::error_categories (ex.code ()).test (ErrorCategory::file_access)) {
@@ -128,32 +120,25 @@ void ErrorStorage::assign(std::exception_ptr eptr) noexcept
128120
129121 // Generic exceptions:
130122 catch (const std::invalid_argument& ex) {
131- printf (" ErrorStorage invalid argument error message: %s\n " , ex.what ());
132123 populate_error (ex, ErrorCodes::InvalidArgument);
133124 }
134125 catch (const std::out_of_range& ex) {
135- printf (" ErrorStorage out_of_range error message: %s\n " , ex.what ());
136126 populate_error (ex, ErrorCodes::OutOfBounds);
137127 }
138128 catch (const std::logic_error& ex) {
139- printf (" ErrorStorage std::logic_error message: %s\n " , ex.what ());
140129 populate_error (ex, ErrorCodes::LogicError);
141130 }
142131 catch (const std::runtime_error& ex) {
143- printf (" ErrorStorage std::runtime_error message: %s\n " , ex.what ());
144132 populate_error (ex, ErrorCodes::RuntimeError);
145133 }
146134 catch (const std::bad_alloc& ex) {
147- printf (" ErrorStorage std::exception message: %s\n " , ex.what ());
148135 populate_error (ex, ErrorCodes::OutOfMemory);
149136 }
150137 catch (const std::exception& ex) {
151- printf (" ErrorStorage std::exceptio message: %s\n " , ex.what ());
152138 populate_error (ex, ErrorCodes::UnknownError);
153139 }
154140 // FIXME: Handle more exception types.
155141 catch (...) {
156- printf (" ErrorStorage RLM_ERR_UNKNOWN message\n " );
157142 m_err->error = RLM_ERR_UNKNOWN;
158143 m_message_buf = " Unknown error" ;
159144 m_err->message = m_message_buf.c_str ();
@@ -167,20 +152,14 @@ bool ErrorStorage::has_error() const noexcept
167152
168153bool ErrorStorage::get_as_realm_error_t (realm_error_t * out) const noexcept
169154{
170- printf (" bool ErrorStorage::get_as_realm_error_t(realm_error_t* out) const noexcept\n " );
171155 if (!m_err) {
172- printf (" no m_err. returning false\n " );
173156 return false ;
174157 }
175158
176159 if (out) {
177- printf (" m_err found. returning true\n " );
178160 *out = *m_err;
179- if ((*m_err).usercode_error != nullptr ) {
180- printf (" m_err.usercode_error != nullptr\n " );
181- }
182161 }
183- printf ( " m_err found. returning true \n " );
162+
184163 return true ;
185164}
186165
@@ -193,7 +172,6 @@ bool ErrorStorage::clear() noexcept
193172
194173void ErrorStorage::set_usercode_error (void * usercode_error)
195174{
196- printf (" setting usercode_error ptr %p\n " , usercode_error);
197175 m_usercode_error = usercode_error;
198176}
199177
@@ -206,7 +184,6 @@ void* ErrorStorage::get_and_clear_usercode_error()
206184
207185ErrorStorage* ErrorStorage::get_thread_local ()
208186{
209- printf (" ErrorStorage* ErrorStorage::get_thread_local()\n " );
210187#if !defined(RLM_NO_THREAD_LOCAL)
211188 static thread_local ErrorStorage g_error_storage;
212189 return &g_error_storage;
@@ -271,6 +248,5 @@ RLM_EXPORT bool realm_wrap_exceptions(void (*func)()) noexcept
271248
272249RLM_API void realm_register_user_code_callback_error (void * usercode_error) noexcept
273250{
274- printf (" RLM_API void realm_register_user_code_callback_error(void* usercode_error) noexcept\n " );
275251 realm::c_api::ErrorStorage::get_thread_local ()->set_usercode_error (usercode_error);
276252}
0 commit comments