MCPcopy Create free account
hub / github.com/apache/cloudberry / CloneErrorMsg

Method CloneErrorMsg

src/backend/gpopt/utils/COptTasks.cpp:164–184  ·  view source on GitHub ↗

--------------------------------------------------------------------------- @function: SOptContext::CloneErrorMsg @doc: Clone m_error_msg to given memory context. Return NULL if there is no error message. ---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

162//
163//---------------------------------------------------------------------------
164CHAR *
165SOptContext::CloneErrorMsg(MemoryContext context, BOOL *clone_failed) const
166{
167 *clone_failed = false;
168
169 if (nullptr == context || nullptr == m_error_msg)
170 {
171 return nullptr;
172 }
173
174 CHAR *error_msg;
175 GPOS_TRY
176 {
177#ifdef FAULT_INJECTOR
178 if (gpdb::InjectFaultInOptTasks("opt_clone_error_msg") == FaultInjectorTypeSkip)
179 {
180 GpdbEreport(ERRCODE_INTERNAL_ERROR, ERROR, "Injected error", nullptr);
181 }
182#endif
183 error_msg = gpdb::MemCtxtStrdup(context, m_error_msg);
184 }
185 GPOS_CATCH_EX(ex)
186 {
187 error_msg = nullptr;

Callers 1

GPOS_CATCH_EXFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected