Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-3106] Refactor aerospike.exception initialization code and check if error indicator is set after calling a C-API method #661

Merged
merged 47 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6eac859
WIP not done
juliannguyen4 Aug 29, 2024
7f20a8c
finish first round of refactor work
juliannguyen4 Aug 29, 2024
814147f
fix compiler errs
juliannguyen4 Aug 29, 2024
e2adcda
use null terminated arrays
juliannguyen4 Aug 29, 2024
53fc366
name struct
juliannguyen4 Aug 29, 2024
6f0206d
fix
juliannguyen4 Aug 29, 2024
1a7e961
fix
juliannguyen4 Aug 29, 2024
99f6aa2
fix compiler error
juliannguyen4 Aug 29, 2024
79e2a9b
add ;
juliannguyen4 Aug 29, 2024
434f06b
Inline list of attrs
juliannguyen4 Aug 29, 2024
04dbfb5
Define const arrays and use them in struct defs
juliannguyen4 Aug 29, 2024
56c8f47
Forgot to insert dot and leave room for that and null char
juliannguyen4 Aug 29, 2024
025ab6e
fix ref count leak
juliannguyen4 Aug 29, 2024
528a4b4
Iterate through list of attrs properly (will still seg fault)
juliannguyen4 Aug 29, 2024
98e9e1b
fix
juliannguyen4 Aug 29, 2024
9d75c4a
cleanup
juliannguyen4 Aug 29, 2024
b85ed77
Fix regression
juliannguyen4 Aug 29, 2024
7cbae14
Fix loop
juliannguyen4 Aug 29, 2024
77ef43f
use macro to prepend submodule name
juliannguyen4 Aug 29, 2024
f0dbdb7
rename macros
juliannguyen4 Aug 30, 2024
b177ed9
dont seg fault if exception init fails
juliannguyen4 Aug 30, 2024
6e44824
mv
juliannguyen4 Aug 30, 2024
a63ad33
specify both class name and fqn in struct
juliannguyen4 Aug 30, 2024
7caa534
use macro to generate structs
juliannguyen4 Aug 30, 2024
b1aa1d5
fix
juliannguyen4 Aug 30, 2024
dfeda6f
fix
juliannguyen4 Aug 30, 2024
3ac0ec8
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-c-glue-cod…
juliannguyen4 Aug 30, 2024
9e5f9ee
continue
juliannguyen4 Sep 3, 2024
66b2569
cleanup
juliannguyen4 Sep 3, 2024
d48bdb9
update comments
juliannguyen4 Sep 4, 2024
2304b0a
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-c-glue-cod…
juliannguyen4 Sep 4, 2024
de3bf5c
fix docs
juliannguyen4 Sep 4, 2024
4c35453
add regression tests for exception classes
juliannguyen4 Sep 4, 2024
91e0f45
fix test
juliannguyen4 Sep 4, 2024
af7fa4b
f
juliannguyen4 Sep 4, 2024
e2c4e1f
test attrs
juliannguyen4 Sep 4, 2024
68c466a
fmt, dont check for in doubt
juliannguyen4 Sep 4, 2024
eaee5f8
cleanup
juliannguyen4 Sep 4, 2024
64246fa
fix
juliannguyen4 Sep 4, 2024
65e0c54
Fix doc errors
juliannguyen4 Sep 5, 2024
dc2430c
fix
juliannguyen4 Sep 5, 2024
8d353a0
comment
juliannguyen4 Sep 5, 2024
29b0184
test error codes
juliannguyen4 Sep 5, 2024
0ee6c3e
mv
juliannguyen4 Sep 5, 2024
93560e1
Fix
juliannguyen4 Sep 5, 2024
3b376b5
see what happens
juliannguyen4 Sep 5, 2024
13227ed
Revert "see what happens"
juliannguyen4 Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions doc/exception.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ Server Errors

Subclass of :py:exc:`~aerospike.exception.ServerError`.

.. py:exception:: QueryAbortedError

Query was aborted.

Error code: ``210``

Subclass of :py:exc:`~aerospike.exception.ServerError`.

Record Errors
-------------

Expand Down Expand Up @@ -397,14 +405,6 @@ Record Errors

Subclass of :py:exc:`~aerospike.exception.RecordError`.

.. py:exception:: QueryAbortedError

Query was aborted.

Error code: ``210``

Subclass of :py:exc:`~aerospike.exception.ClientError`.

Index Errors
------------

Expand Down Expand Up @@ -487,7 +487,7 @@ Query Errors

Error code: ``213``

Subclass of :py:exc:`~aerospike.exception.AerospikeError`.
Subclass of :py:exc:`~aerospike.exception.ServerError`.

Cluster Errors
--------------
Expand All @@ -507,7 +507,7 @@ Cluster Errors

Error code: ``11``

Subclass of :py:exc:`~aerospike.exception.AerospikeError`.
Subclass of :py:exc:`~aerospike.exception.ServerError`.

Admin Errors
------------
Expand All @@ -516,6 +516,8 @@ Admin Errors

The parent class for exceptions of the security API.

Subclass of :py:exc:`~aerospike.exception.ServerError`.

.. py:exception:: SecurityNotSupported

Security functionality not supported by connected server.
Expand Down
4 changes: 4 additions & 0 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ PyMODINIT_FUNC PyInit_aerospike(void)
py_global_hosts = PyDict_New();

PyObject *exception = AerospikeException_New();
if (exception == NULL) {
return NULL;
}

Py_INCREF(exception);
int retval = PyModule_AddObject(aerospike, "exception", exception);
if (retval == -1) {
Expand Down
Loading
Loading