File:  [parser3project] / parser3 / src / main / pa_exception.C
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Jan 30 11:51:07 2001 UTC (25 years, 5 months ago) by paf
Branches: MAIN
CVS tags: HEAD
lowered targets/parser into subdir, added parser_Pool(Pool)
failed to add. would think..

/*
  $Id: pa_exception.C,v 1.1 2001/01/30 11:51:07 paf Exp $
*/

#include <stdio.h>
#include <stdlib.h>

#include "pa_exception.h"
#include "pa_common.h"

Exception::Exception() : 
	ftype(0),
	fcode(0),
	fproblem_source(0),
	fcomment("") {
}

void Exception::die(char *acomment) {
	// FIX: log(LOG_ERROR, acomment)
	fprintf(stderr, "die: %s\n", acomment);
	exit(1);
}

void Exception::raise(const String *atype, const String *acode,
					  const String *aproblem_source, 
					  const char *comment_fmt, ...) {
	ftype=atype;
	fcode=acode;
	fproblem_source=aproblem_source;
	
	va_list args;
    va_start(args, comment_fmt);
    vsnprintf(fcomment, MAX_STRING, comment_fmt, args);
    va_end(args);

	longjmp(mark, 1);
}

E-mail: