Print something on stderr in case of exceptions in callback routines.

This commit is contained in:
Jack Jansen 1999-06-21 16:18:51 +00:00
parent c4f6331690
commit 58b2eacf6b
2 changed files with 18 additions and 6 deletions

View File

@ -970,8 +970,10 @@ dragglue_TrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow,
return -1;
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in TrackingHandler\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;
@ -993,8 +995,10 @@ dragglue_ReceiveHandler(WindowPtr theWindow, void *handlerRefCon,
return -1;
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in ReceiveHandler\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;
@ -1019,8 +1023,10 @@ dragglue_SendData(FlavorType theType, void *dragSendRefCon,
return -1;
rv = PyEval_CallObject(self->sendproc, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in SendDataHandler\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;

View File

@ -89,8 +89,10 @@ dragglue_TrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow,
return -1;
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in TrackingHandler\\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;
@ -112,8 +114,10 @@ dragglue_ReceiveHandler(WindowPtr theWindow, void *handlerRefCon,
return -1;
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in ReceiveHandler\\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;
@ -138,8 +142,10 @@ dragglue_SendData(FlavorType theType, void *dragSendRefCon,
return -1;
rv = PyEval_CallObject(self->sendproc, args);
Py_DECREF(args);
if ( rv == NULL )
if ( rv == NULL ) {
fprintf(stderr, "Drag: Exception in SendDataHandler\\n");
return -1;
}
i = -1;
if ( rv == Py_None )
i = 0;