jaaql-middleware-python 5.3.18__tar.gz → 5.3.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/PKG-INFO +1 -1
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/constants.py +1 -1
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_interface.py +9 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_pg_interface.py +6 -1
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/jaaql_interpretable_handled_errors.py +16 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/interpreter/interpret_jaaql.py +5 -4
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql_middleware_python.egg-info/PKG-INFO +1 -1
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/LICENSE.txt +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/README.md +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/config-docker.ini +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/config-test.ini +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/config.ini +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config_constants.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_utils.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_utils_no_circ.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/documentation/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/documentation/documentation_internal.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/documentation/documentation_public.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/documentation/documentation_shared.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/email/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/email/email_manager.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/email/email_manager_service.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/email/patch_ems.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/custom_http_status.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/http_status_exception.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/not_yet_implement_exception.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/generated_constants.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/interpreter/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/jaaql.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/migrations/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/migrations/migrations.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/base_controller.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/base_model.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/controller.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/controller_interface.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/exception_queries.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/generated_queries.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/handmade_queries.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/model.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/model_interface.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/response.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/openapi/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/openapi/swagger_documentation.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/patch.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/01.install_domains.generated.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/02.install_super_user.exceptions.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/03.install_super_user.handwritten.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/04.install_jaaql_data_structures.generated.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/05.install_static_data.generated.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/06.install_jaaql.exceptions.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/ZZZZ.generated_functions_views_and_permissions.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/ZZZZ.reset_references.sql +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/scripts/swagger_template.html +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/cached_canned_query_service.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/migrations_manager_service.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/patch_mms.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/patch_shared_var_service.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/shared_var_service.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/__init__.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/bootstrap_secrets.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/cron.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/crypt_utils.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/options.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/utils.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/utils_no_project_imports.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/vault.py +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql_middleware_python.egg-info/SOURCES.txt +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql_middleware_python.egg-info/dependency_links.txt +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql_middleware_python.egg-info/requires.txt +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql_middleware_python.egg-info/top_level.txt +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/setup.cfg +0 -0
- {jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaaql-middleware-python
|
|
3
|
-
Version: 5.3.
|
|
3
|
+
Version: 5.3.19
|
|
4
4
|
Summary: The jaaql package, allowing for rapid development and deployment of RESTful HTTP applications
|
|
5
5
|
Home-page: https://github.com/JAAQL/JAAQL-middleware-python
|
|
6
6
|
Author: Software Quality Measurement and Improvement bv
|
|
@@ -120,9 +120,18 @@ class DBInterface(ABC):
|
|
|
120
120
|
# re-run on a fresh connection; any other commit failure is a genuine error.
|
|
121
121
|
if self.is_connection_error(commit_err):
|
|
122
122
|
raise ConnectionLostError(str(commit_err))
|
|
123
|
+
translated = self.translate_commit_error(commit_err)
|
|
124
|
+
if translated is not None:
|
|
125
|
+
raise translated
|
|
123
126
|
raise HttpStatusException("Commit failed, transaction not persisted: " + str(commit_err),
|
|
124
127
|
HTTPStatus.INTERNAL_SERVER_ERROR)
|
|
125
128
|
|
|
129
|
+
def translate_commit_error(self, commit_err):
|
|
130
|
+
# A deferred constraint trigger raises at COMMIT rather than during its statement. When what it
|
|
131
|
+
# raises is an error the statement path would have handed back as a handled error, a subclass
|
|
132
|
+
# returns that error here so the caller sees the same response either way; None keeps the 500
|
|
133
|
+
return None
|
|
134
|
+
|
|
126
135
|
def handle_error(self, conn, err, echo=ECHO__none):
|
|
127
136
|
commit_err = self.__attempt_commit_rollback(conn, err)
|
|
128
137
|
if err is None and commit_err is not None:
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_pg_interface.py
RENAMED
|
@@ -12,7 +12,7 @@ from jaaql.constants import ERR__invalid_token
|
|
|
12
12
|
from jaaql.db.db_interface import DBInterface, ECHO__none, CHAR__newline
|
|
13
13
|
from jaaql.exceptions.http_status_exception import *
|
|
14
14
|
from jaaql.exceptions.custom_http_status import CustomHTTPStatus
|
|
15
|
-
from jaaql.exceptions.jaaql_interpretable_handled_errors import UserUnauthorized
|
|
15
|
+
from jaaql.exceptions.jaaql_interpretable_handled_errors import UserUnauthorized, handled_procedure_error_from_raise
|
|
16
16
|
from jaaql.constants import KEY__database
|
|
17
17
|
|
|
18
18
|
ERR__connect_db = "Could not create connection to database!"
|
|
@@ -443,6 +443,11 @@ class DBPGInterface(DBInterface):
|
|
|
443
443
|
# persisted nothing, so the operation is safe to retry on a fresh connection.
|
|
444
444
|
return isinstance(ex, OperationalError)
|
|
445
445
|
|
|
446
|
+
def translate_commit_error(self, commit_err):
|
|
447
|
+
if not isinstance(commit_err, psycopg.Error):
|
|
448
|
+
return None
|
|
449
|
+
return handled_procedure_error_from_raise(commit_err)
|
|
450
|
+
|
|
446
451
|
def handle_db_error(self, err, echo):
|
|
447
452
|
if isinstance(err, ProgrammingError) and hasattr(err, 'pgresult'):
|
|
448
453
|
err = err.pgresult.error_message.decode("UTF-8")
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from jaaql.constants import SQLStateJaaql
|
|
1
4
|
from jaaql.exceptions.http_status_exception import JaaqlInterpretableHandledError
|
|
2
5
|
|
|
3
6
|
|
|
@@ -43,6 +46,19 @@ class HandledProcedureError(JaaqlInterpretableHandledError):
|
|
|
43
46
|
)
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
def handled_procedure_error_from_raise(ex):
|
|
50
|
+
# A JQ000 raise carries a JSON array of error records, whether it surfaced during its statement or at
|
|
51
|
+
# COMMIT from a deferred trigger; one that does not is left to the caller as an unhandled error
|
|
52
|
+
diag = getattr(ex, "diag", None)
|
|
53
|
+
if diag is None or diag.sqlstate != SQLStateJaaql:
|
|
54
|
+
return None
|
|
55
|
+
try:
|
|
56
|
+
descriptor = json.loads(diag.message_primary)
|
|
57
|
+
except (TypeError, ValueError):
|
|
58
|
+
return None
|
|
59
|
+
return HandledProcedureError(message=None, index=None, table_name=None, descriptor=descriptor)
|
|
60
|
+
|
|
61
|
+
|
|
46
62
|
class UnhandledQueryError(JaaqlInterpretableHandledError):
|
|
47
63
|
def __init__(self, message, _set, table_name=None, column_name=None, descriptor=None):
|
|
48
64
|
super().__init__(
|
|
@@ -14,8 +14,8 @@ import json
|
|
|
14
14
|
from jaaql.db.db_interface import DBInterface, ECHO__none
|
|
15
15
|
from psycopg.errors import OperationalError, Error
|
|
16
16
|
from jaaql.constants import KEY__position, KEY__file, KEY__application, KEY__error, KEY__error_row_number, KEY__error_query, \
|
|
17
|
-
KEY__error_set, KEY__error_index,
|
|
18
|
-
from jaaql.exceptions.jaaql_interpretable_handled_errors import DatabaseOperationalError, HandledProcedureError, UnhandledQueryError, UnhandledProcedureError, \
|
|
17
|
+
KEY__error_set, KEY__error_index, KEY__restrictions, REGEX__dmbs_object_name
|
|
18
|
+
from jaaql.exceptions.jaaql_interpretable_handled_errors import handled_procedure_error_from_raise, DatabaseOperationalError, HandledProcedureError, UnhandledQueryError, UnhandledProcedureError, \
|
|
19
19
|
SingletonExpected
|
|
20
20
|
from typing import Union
|
|
21
21
|
from functools import lru_cache
|
|
@@ -605,8 +605,9 @@ ORDER BY d.column_name;
|
|
|
605
605
|
}
|
|
606
606
|
)
|
|
607
607
|
elif isinstance(ex, Error):
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
handled = handled_procedure_error_from_raise(ex)
|
|
609
|
+
if handled is not None:
|
|
610
|
+
err = handled
|
|
610
611
|
elif query_key == "_jaaql_procedure":
|
|
611
612
|
err = UnhandledProcedureError(
|
|
612
613
|
message=str(ex),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaaql-middleware-python
|
|
3
|
-
Version: 5.3.
|
|
3
|
+
Version: 5.3.19
|
|
4
4
|
Summary: The jaaql package, allowing for rapid development and deployment of RESTful HTTP applications
|
|
5
5
|
Home-page: https://github.com/JAAQL/JAAQL-middleware-python
|
|
6
6
|
Author: Software Quality Measurement and Improvement bv
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/config-docker.ini
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/config/config-test.ini
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/db/db_utils_no_circ.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/documentation/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/email/email_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/exceptions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/generated_constants.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/interpreter/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/migrations/__init__.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/migrations/migrations.py
RENAMED
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/base_controller.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/controller_interface.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/exception_queries.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/generated_queries.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/handmade_queries.py
RENAMED
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/mvc/model_interface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/services/patch_mms.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/crypt_utils.py
RENAMED
|
File without changes
|
{jaaql_middleware_python-5.3.18 → jaaql_middleware_python-5.3.19}/jaaql/utilities/options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|