From 54949779a95fff21db7dcb1a5e0f1501f049492a Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 4 Jun 2001 23:18:08 +0000 Subject: [PATCH] dont always use default exception handler --- src/ca/oldChannelNotify.cpp | 13 ++++++------- src/ca/syncGroup.h | 5 +++++ src/ca/syncGroupReadNotify.cpp | 5 ++--- src/ca/syncGroupWriteNotify.cpp | 6 ++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/ca/oldChannelNotify.cpp b/src/ca/oldChannelNotify.cpp index 50ddf131e..1e0ea94b7 100644 --- a/src/ca/oldChannelNotify.cpp +++ b/src/ca/oldChannelNotify.cpp @@ -34,7 +34,7 @@ extern "C" void cacNoopAccesRightsHandler ( struct access_rights_handler_args ) oldChannelNotify::oldChannelNotify ( oldCAC &cacIn, const char *pName, caCh *pConnCallBackIn, void *pPrivateIn ) : - io ( cacIn.createChannel ( pName, *this ) ), + io ( cacIn.createChannel ( pName, *this ) ), cacCtx ( cacIn ), pConnCallBack ( pConnCallBackIn ? pConnCallBackIn : cacNoopConnHandler ), pPrivate ( pPrivateIn ), pAccessRightsFunc ( cacNoopAccesRightsHandler ) { @@ -110,22 +110,21 @@ void oldChannelNotify::accessRightsNotify ( const caAccessRights &ar ) void oldChannelNotify::exception ( int status, const char *pContext ) { - ca_signal ( status, pContext ); + this->cacCtx.exception ( status, pContext, __FILE__, __LINE__ ); } void oldChannelNotify::readException ( int status, const char *pContext, unsigned type, arrayElementCount count, void *pValue ) { - ca_signal_formated ( status, 0, 0u, "ctx=%s type=%s count=%u ptr=%p", - pContext, dbr_type_to_text ( static_cast < int > ( type ) ), - count, pValue ); + this->cacCtx.exception ( status, pContext, + __FILE__, __LINE__, *this, type, count, CA_OP_GET ); } void oldChannelNotify::writeException ( int status, const char *pContext, unsigned type, arrayElementCount count ) { - ca_signal_formated ( status, 0, 0u, "ctx=%s type=%s count=%u", - pContext, dbr_type_to_text ( static_cast < int > ( type ) ), count ); + this->cacCtx.exception ( status, pContext, + __FILE__, __LINE__, *this, type, count, CA_OP_PUT ); } bool oldChannelNotify::includeFirstConnectInCountOfOutstandingIO () const diff --git a/src/ca/syncGroup.h b/src/ca/syncGroup.h index 53c7faec4..7ab756687 100644 --- a/src/ca/syncGroup.h +++ b/src/ca/syncGroup.h @@ -120,6 +120,11 @@ public: void * operator new ( size_t size ); void operator delete ( void *pCadaver, size_t size ); int printf ( const char * pFormat, ... ); + void exception ( int status, const char *pContext, + const char *pFileName, unsigned lineNo ); + void exception ( int status, const char *pContext, + const char *pFileName, unsigned lineNo, oldChannelNotify &chan, + unsigned type, arrayElementCount count, unsigned op ); protected: virtual ~CASG (); private: diff --git a/src/ca/syncGroupReadNotify.cpp b/src/ca/syncGroupReadNotify.cpp index 8eb3eaf5d..5a51c8df5 100644 --- a/src/ca/syncGroupReadNotify.cpp +++ b/src/ca/syncGroupReadNotify.cpp @@ -81,9 +81,8 @@ void syncGroupReadNotify::completion ( void syncGroupReadNotify::exception ( int status, const char *pContext, unsigned type, arrayElementCount count ) { - ca_signal_formated ( status, __FILE__, __LINE__, - "CA sync group read request failed with chan=%s type=%d count=%ld because \"%s\"\n", - this->chan->pName(), type, count, pContext); + this->sg.exception ( status, pContext, + __FILE__, __LINE__, *this->chan, type, count, CA_OP_GET ); // // This notify is left installed at this point as a place holder indicating that // all requests have not been completed. This notify is not uninstalled until diff --git a/src/ca/syncGroupWriteNotify.cpp b/src/ca/syncGroupWriteNotify.cpp index 4a6d2cd4d..29d42cc7f 100644 --- a/src/ca/syncGroupWriteNotify.cpp +++ b/src/ca/syncGroupWriteNotify.cpp @@ -75,10 +75,8 @@ void syncGroupWriteNotify::completion () void syncGroupWriteNotify::exception ( int status, const char *pContext, unsigned type, arrayElementCount count ) { - ca_signal_formated ( status, __FILE__, __LINE__, - "CA sync group write request for channel \"%s\" failed because \"%s\" type=%s count=%u\n", - this->chan->pName(), pContext, - dbr_type_to_text ( static_cast < int > ( type ) ), count); + this->sg.exception ( status, pContext, + __FILE__, __LINE__, *this->chan, type, count, CA_OP_PUT ); // // This notify is left installed at this point as a place holder indicating that // all requests have not been completed. This notify is not uninstalled until