🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10680

exception "catch" clause

#10680
From: p Anders
Date: Thu, 25 Mar 2004 12:13
47 lines
2180 bytes
I'm trying to write a macro to use in place of a catch clause in order to
save myself 18 lines of code wherever I need the catch clause.  The macro is
defined as:

#define AMF_BaseC_CATCH_EXCEPTION(Severity)
(                                    \
   catch (AMF_AF_ExceptionC& amfException)
\

{                                                                          \
      amfException.SetType(Severity);
\
      sm_ErrorHandler->ReportException(amfException);
\
      }
\
   catch (runtime_error& e)
\

{                                                                          \
      AMF_AF_ExceptionC amfException(e);
\
      amfException.SetType(Severity);
\
      sm_ErrorHandler->ReportException(amfException);
\
      }
\
   catch (...)
\

{                                                                          \
      AMF_AF_ExceptionC amfException(Severity,
\
                                     "Caught an unspecified
AMF_AF_ExceptionC!", \
                                     __FILE__, m_tClassName.c_str(),
__FUNC__);  \
      sm_ErrorHandler->ReportException(amfException);
\
      } )

I get a compoile error that says a "catch clause" was expected.

Can I not use a macro here?

Thanks.
Technical Details
Message-ID: <4062cd03$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d6b749007e0005d0,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-25 04:39:42 PST
Reply-To: "p Anders" <paul.anderson@jhuapl.edu>
From: "p Anders" <paul.anderson@jhuapl.edu>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: exception "catch" clause
Date: Thu, 25 Mar 2004 07:13:55 -0500
Lines: 49
Organization: JHU/APL
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 128.244.21.78
Message-ID: <4062cd03$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080216835 128.244.21.78 (25 Mar 2004 04:13:55 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail