forked from tada/pljava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathException.h
More file actions
77 lines (67 loc) · 2.52 KB
/
Copy pathException.h
File metadata and controls
77 lines (67 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Copyright (c) 2004, 2005, 2006 TADA AB - Taby Sweden
* Distributed under the terms shown in the file COPYRIGHT
* found in the root folder of this project or at
* http://eng.tada.se/osprojects/COPYRIGHT.html
*
* @author Thomas Hallgren
*/
#ifndef __pljava_Exception_h
#define __pljava_Exception_h
#include "pljava/PgObject.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************
* Java exception related things
*
* @author Thomas Hallgren
*
*******************************************************************/
/*
* Trows an UnsupportedOperationException informing the caller that the
* requested feature doesn't exist in the current version, it was introduced
* starting with the intro version.
*/
extern void Exception_featureNotSupported(const char* requestedFeature, const char* introVersion);
/*
* Like ereport(ERROR, ...) but this method will raise a Java SQLException and
* return. It will NOT do a longjmp. Suitable in native code that is called
* from Java (such code must return to Java in order to have the real exception
* thrown).
*/
extern void Exception_throw(int errCode, const char* errMessage, ...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
__attribute__((format(printf, 2, 3)));
/*
* Like ereport(ERROR, ...) but this method will raise a Java IllegalArgumentException and
* return. It will NOT do a longjmp. Suitable in native code that is called
* from Java (such code must return to Java in order to have the real exception
* thrown).
*/
extern void Exception_throwIllegalArgument(const char* errMessage, ...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
__attribute__((format(printf, 1, 2)));
/*
* Like ereport(ERROR, ...) but this method will raise a Java SQLException and
* return. It will NOT do a longjmp.
*/
extern void Exception_throwSPI(const char* function, int errCode);
/*
* This method will raise a Java ServerException based on an ErrorData obtained
* by a call to CopyErrorData. It will NOT do a longjmp. It's intended use is
* in PG_CATCH clauses.
*/
extern void Exception_throw_ERROR(const char* function);
/*
* Throw an exception indicating that wanted member could not be
* found. This is an ereport(ERROR...) so theres' no return from
* this function.
*/
extern void Exception_throwMemberError(const char* memberName, const char* signature, bool isMethod, bool isStatic);
#ifdef __cplusplus
}
#endif
#endif