OpenJAUS Software Development Kit  4.3.1
Classes | Namespaces | Macros
Exception.h File Reference
#include "openjaus/system/Event.h"
#include <string>
#include "openjaus/types.h"
#include <ostream>
#include "openjaus/system/Logger.h"
#include "openjaus/system/Application.h"
#include <sstream>
#include <stdio.h>

Classes

class  openjaus::system::Exception
 

Namespaces

 openjaus
 
 openjaus::system
 

Macros

#define LOG_EXCEPTION(msg)
 
#define THROW_EXCEPTION(msg)
 
#define RETURN_AFTER_EXCEPTION(x)
 

Detailed Description

Copyright
Copyright (c) 2010-2016, OpenJAUS, LLC All rights reserved.

This file is part of the OpenJAUS Software Development Kit (SDK). This software is distributed under one of two licenses, the OpenJAUS SDK Commercial End User License Agreement or the OpenJAUS SDK Non-Commercial End User License Agreement. The appropriate licensing details were included in with your developer credentials and software download. See the LICENSE file included with this software for full details.

THIS SOFTWARE IS PROVIDED BY THE LICENSOR (OPENJAUS LCC) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE LICENSOR DOES NOT WARRANT THAT THE LICENSED SOFTWARE WILL MEET LICENSEE'S REQUIREMENTS OR THAT THE OPERATION OF THE LICENSED SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ERRORS IN THE LICENSED SOFTWARE WILL BE CORRECTED.

\ Software History

Macro Definition Documentation

§ LOG_EXCEPTION

#define LOG_EXCEPTION (   msg)
Value:
{ \
std::ostringstream ostream; \
ostream << OJ_LOG_PREAMBLE << msg; \
::openjaus::system::Exception expn(ostream.str(), __FILE__, __LINE__); \
}
#define OJ_LOG_PREAMBLE
Definition: Logger.h:56
static bool log(Event event)
Operation log.
Definition: Logger.cpp:80
Definition: Exception.h:98

§ RETURN_AFTER_EXCEPTION

#define RETURN_AFTER_EXCEPTION (   x)

§ THROW_EXCEPTION

#define THROW_EXCEPTION (   msg)
Value:
{ \
std::ostringstream ostream; \
ostream << "[" << time << "] " << OJ_LOG_PREAMBLE << msg; \
::openjaus::system::Exception expn(ostream.str(), __FILE__, __LINE__); \
if(!::openjaus::system::Application::setting<bool>("SupressExceptionsFile", false)) \
{ \
std::string fileName = ::openjaus::system::Application::getName(); \
fileName += "-exception.out"; \
FILE *fp = fopen(fileName.c_str(), "a"); \
if (fp) \
{ \
fputs(expn.toString().c_str(), fp); \
fputs("\n", fp); \
fclose(fp); \
} \
} \
throw expn; \
}
#define OJ_LOG_PREAMBLE
Definition: Logger.h:56
This is a brief description.
Definition: Time.h:57
static Time getTime()
Operation getTime.
Definition: Time.cpp:120
static std::string getName()
Operation getName.
Definition: Application.cpp:279
static bool log(Event event)
Operation log.
Definition: Logger.cpp:80
Definition: Exception.h:98