2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-08-28 12:19:56 +04:00
|
|
|
|
|
|
|
#ifndef MITRE_ERROROBSERVER_H
|
|
|
|
#define MITRE_ERROROBSERVER_H
|
|
|
|
|
2005-11-02 10:42:16 +03:00
|
|
|
#include "txCore.h"
|
2005-11-02 10:38:24 +03:00
|
|
|
|
1999-08-28 12:19:56 +04:00
|
|
|
/**
|
|
|
|
* A simple interface for observing errors
|
|
|
|
**/
|
|
|
|
class ErrorObserver {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Default Destructor for ErrorObserver
|
|
|
|
**/
|
|
|
|
virtual ~ErrorObserver(){};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-08-28 12:19:56 +04:00
|
|
|
/**
|
2005-11-02 10:37:50 +03:00
|
|
|
* Notifies this Error observer of a new error aRes
|
1999-08-28 12:19:56 +04:00
|
|
|
**/
|
2005-11-02 10:39:22 +03:00
|
|
|
virtual void receiveError(const nsAString& errorMessage, nsresult aRes) = 0;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-08-28 12:19:56 +04:00
|
|
|
/**
|
2005-11-02 10:37:50 +03:00
|
|
|
* Notifies this Error observer of a new error, with default
|
|
|
|
* error code NS_ERROR_FAILURE
|
1999-08-28 12:19:56 +04:00
|
|
|
**/
|
2005-11-02 10:39:22 +03:00
|
|
|
void receiveError(const nsAString& errorMessage) {
|
2005-11-02 10:37:50 +03:00
|
|
|
receiveError(errorMessage, NS_ERROR_FAILURE);
|
|
|
|
}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-08-28 12:19:56 +04:00
|
|
|
}; //-- ErrorObserver
|
|
|
|
|
|
|
|
#endif
|