greenplumn IErrorContext 源码

  • 2022-08-18
  • 浏览 (390)

greenplumn IErrorContext 代码

文件路径:/src/backend/gporca/libgpos/include/gpos/error/IErrorContext.h

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2011 EMC Corp.
//
//	@filename:
//		IErrorContext.h
//
//	@doc:
//		Interface for error context to record error message, stack, etc.
//---------------------------------------------------------------------------
#ifndef GPOS_IErrorContext_H
#define GPOS_IErrorContext_H

#include "gpos/error/CException.h"
#include "gpos/types.h"

namespace gpos
{
//---------------------------------------------------------------------------
//	@class:
//		IErrorContext
//
//	@doc:
//		Abstraction for context object, owned by Task
//
//---------------------------------------------------------------------------
class IErrorContext
{
private:
public:
	IErrorContext(const IErrorContext &) = delete;

	// ctor
	IErrorContext() = default;

	// dtor
	virtual ~IErrorContext() = default;

	// reset context, clear out handled error
	virtual void Reset() = 0;

	// record error context
	virtual void Record(CException &exc, VA_LIST) = 0;

	// exception accessor
	virtual CException GetException() const = 0;

	// error message accessor
	virtual const WCHAR *GetErrorMsg() const = 0;

	// copy necessary info for error propagation
	virtual void CopyPropErrCtxt(const IErrorContext *err_ctxt) = 0;

	// severity accessor
	virtual ULONG GetSeverity() const = 0;

	// set severity
	virtual void SetSev(ULONG severity) = 0;

	// print error stack trace
	virtual void AppendStackTrace() = 0;

	// print errno message
	virtual void AppendErrnoMsg() = 0;

	// check if there is a pending exception
	virtual BOOL IsPending() const = 0;

	// check if exception is rethrown
	virtual BOOL IsRethrown() const = 0;

	// mark that exception is rethrown
	virtual void SetRethrow() = 0;

};	// class IErrorContext
}  // namespace gpos

#endif	// !GPOS_IErrorContext_H

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CAutoExceptionStack 源码

greenplumn CAutoTrace 源码

greenplumn CErrorContext 源码

greenplumn CErrorHandler 源码

greenplumn CErrorHandlerStandard 源码

greenplumn CException 源码

greenplumn CLogger 源码

greenplumn CLoggerStream 源码

greenplumn CLoggerSyslog 源码

greenplumn CMessage 源码

0  赞