]> Nutra Git (v1) - nutratech/cli.git/commitdiff
split repr (exc_type/exc_msg), store more bug data
authorShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 22:27:54 +0000 (17:27 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 22:27:54 +0000 (17:27 -0500)
ntclient/__init__.py
ntclient/ntsqlite
ntclient/services/bugs.py

index ed052d15fc305e5e07582d398756cbedd19093f3..5242f3fade5bb37e7c6f3f7ed03dba38fffe6d57 100644 (file)
@@ -24,7 +24,8 @@ __copyright__ = "Copyright 2018-2022 Shane Jaroch"
 __url__ = "https://github.com/nutratech/cli"
 
 # Sqlite target versions
-__db_target_nt__ = "0.0.6"
+# TODO: should this be via versions.csv file?  Don't update in two places?
+__db_target_nt__ = "0.0.7"
 __db_target_usda__ = "0.0.9"
 USDA_XZ_SHA256 = "25dba8428ced42d646bec704981d3a95dc7943240254e884aad37d59eee9616a"
 
index 98564d2266bba91698bccbf4ea90c09db314f503..3c83d295e4d271ef368775777e19285121d47839 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 98564d2266bba91698bccbf4ea90c09db314f503
+Subproject commit 3c83d295e4d271ef368775777e19285121d47839
index 9315b94a40f0b4db91fe567000bee29054cea149..e7d31141e7451e524699598ee5b104b1d3acdc77 100644 (file)
@@ -6,10 +6,12 @@ Created on Tue Feb 13 09:51:48 2024
 @author: shane
 """
 import os
+import platform
 import sqlite3
 import traceback
 
 import ntclient.services.api
+from ntclient import __db_target_nt__, __db_target_usda__, __version__
 from ntclient.persistence.sql.nt import sql as sql_nt
 from ntclient.utils import CLI_CONFIG
 
@@ -21,18 +23,34 @@ def insert(args: list, exception: Exception) -> None:
         sql_nt(
             """
 INSERT INTO bug
-  (profile_id, arguments, repr, stack, client_info, app_info, user_details)
+  (profile_id, arguments, exc_type, exc_msg, stack, client_info, app_info, user_details)
       VALUES
-        (?,?,?,?,?,?,?)
+        (?,?,?,?,?,?,?,?)
             """,
             (
                 1,
                 " ".join(args),
-                repr(exception),
+                exception.__class__.__name__,
+                str(exception),
                 os.linesep.join(traceback.format_tb(exception.__traceback__)),
-                "client_info",
-                "app_info",
-                "user_details",
+                # client_info
+                str(
+                    {
+                        "platform": platform.system(),
+                        "python_version": platform.python_version(),
+                        "client_interface": "cli",
+                    }
+                ),
+                # app_info
+                str(
+                    {
+                        "version": __version__,
+                        "version_nt_db_target": __db_target_nt__,
+                        "version_usda_db_target": __db_target_usda__,
+                    }
+                ),
+                # user_details
+                "NOT_IMPLEMENTED",
             ),
         )
     except sqlite3.IntegrityError as exc: