michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MITRE_ERROROBSERVER_H michael@0: #define MITRE_ERROROBSERVER_H michael@0: michael@0: #include "txCore.h" michael@0: michael@0: /** michael@0: * A simple interface for observing errors michael@0: **/ michael@0: class ErrorObserver { michael@0: michael@0: public: michael@0: michael@0: /** michael@0: * Default Destructor for ErrorObserver michael@0: **/ michael@0: virtual ~ErrorObserver() {}; michael@0: michael@0: /** michael@0: * Notifies this Error observer of a new error aRes michael@0: **/ michael@0: virtual void receiveError(const nsAString& errorMessage, nsresult aRes) = 0; michael@0: michael@0: /** michael@0: * Notifies this Error observer of a new error, with default michael@0: * error code NS_ERROR_FAILURE michael@0: **/ michael@0: void receiveError(const nsAString& errorMessage) michael@0: { michael@0: receiveError(errorMessage, NS_ERROR_FAILURE); michael@0: } michael@0: michael@0: michael@0: michael@0: }; //-- ErrorObserver michael@0: michael@0: #endif