Esempio n. 1
0
UtilityException UtilityException::inherit(
		UTIL_EXCEPTION_CONSTRUCTOR_ARGS_LIST) throw() {

	Exception cause;
	Exception::NamedErrorCode modErrorCode;

	try {
		throw;
	}
	catch (Exception &e) {
		modErrorCode = e.getNamedErrorCode();
		cause = e;
	}
	catch (std::bad_alloc&) {
		modErrorCode = UTIL_EXCEPTION_UTIL_NAMED_CODE(CODE_NO_MEMORY);
	}
	catch (...) {
		modErrorCode = UTIL_EXCEPTION_UTIL_NAMED_CODE(CODE_ILLEGAL_OPERATION);
	}

	return UtilityException(
			(namedErrorCode.isEmpty() ? modErrorCode : namedErrorCode),
			(message == NULL || strlen(message) == 0) ?
					UTIL_EXCEPTION_CREATE_MESSAGE_CHARS(
							cause.getField(Exception::FIELD_MESSAGE)) :
					message,
			fileNameLiteral, functionNameLiteral, lineNumber,
			causeInHandling, typeNameLiteral, stackTraceMode, literalFlags);
}
Esempio n. 2
0
void GSExceptionRegenerator::generate(
	util::Exception &dest, const char8_t *typeName) const throw() {
	util::Exception cause;
	try {
		cause.assign(base_, 1);
		throw cause;
	}
	catch (...) {
		dest = util::Exception(base_.getNamedErrorCode(),
			UTIL_EXCEPTION_CREATE_MESSAGE_CHARS(base_.getField(
				util::Exception::FIELD_MESSAGE)),
			fileNameLiteral_, functionNameLiteral_, base_.getLineNumber(),
			&cause, typeName, util::Exception::STACK_TRACE_NONE,
			base_.inheritLiteralFlags());
	}
}